Click here to Skip to main content
15,888,242 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: C++ GUI Framework Pin
Bernhard Hiller25-Sep-12 23:06
Bernhard Hiller25-Sep-12 23:06 
GeneralRe: C++ GUI Framework Pin
Kosta Cherry26-Sep-12 5:48
Kosta Cherry26-Sep-12 5:48 
GeneralRe: C++ GUI Framework Pin
.Shoaib30-Sep-12 23:26
.Shoaib30-Sep-12 23:26 
GeneralRe: C++ GUI Framework Pin
Eddy Vluggen1-Oct-12 1:18
professionalEddy Vluggen1-Oct-12 1:18 
QuestionOO Algorithms Tutorial? Pin
eddieangel25-Sep-12 6:59
eddieangel25-Sep-12 6:59 
AnswerRe: OO Algorithms Tutorial? Pin
Ravi Bhavnani25-Sep-12 7:15
professionalRavi Bhavnani25-Sep-12 7:15 
AnswerRe: OO Algorithms Tutorial? Pin
Bernhard Hiller25-Sep-12 23:01
Bernhard Hiller25-Sep-12 23:01 
QuestionApplication efficiency? Pin
Neo1010122-Sep-12 22:54
Neo1010122-Sep-12 22:54 
Where in the code do I best put object creation (stateful objects) and where not? In what layers?

For example, I once put an object reference inside a Hibernate DAO class and I was told that this was incorrect because DAO classes are not supposed to have state. State should be inside the 'service layer'.

I have been told that I should not create new objects on recurring method calls such as UpdateCart(). Creation of objects is costly and should not be sitting in your code everywhere. It should be sitting in initialization type methods only. For example, if an e-commerce application needs a cart, put it in the session. If it needs some general main object, put it in the initialization code. Create it once there and let the rest of the application access its instance later. Do not create this instance upon every call.

I'm confused about this whole design principle. The strangest thing I heard is 'an app is not supposed to have state. State should be kept in the data layer where the database is'. Really? I'm quite new to these design concepts and I don't know where to look in order to get more educated on it. GoF? Design Patterns books? The goal is to create qualitative code (i.e. to be used in the business).

Thanks
AnswerRe: Application efficiency? Pin
Eddy Vluggen23-Sep-12 0:36
professionalEddy Vluggen23-Sep-12 0:36 
GeneralRe: Application efficiency? Pin
Neo1010123-Sep-12 0:44
Neo1010123-Sep-12 0:44 
GeneralRe: Application efficiency? Pin
Eddy Vluggen23-Sep-12 0:52
professionalEddy Vluggen23-Sep-12 0:52 
GeneralRe: Application efficiency? Pin
Neo1010123-Sep-12 1:00
Neo1010123-Sep-12 1:00 
GeneralRe: Application efficiency? Pin
Eddy Vluggen23-Sep-12 1:21
professionalEddy Vluggen23-Sep-12 1:21 
GeneralRe: Application efficiency? Pin
jschell23-Sep-12 7:12
jschell23-Sep-12 7:12 
GeneralRe: Application efficiency? Pin
Pete O'Hanlon23-Sep-12 8:04
mvePete O'Hanlon23-Sep-12 8:04 
GeneralRe: Application efficiency? Pin
dojohansen10-Oct-12 4:15
dojohansen10-Oct-12 4:15 
GeneralRe: Application efficiency? Pin
dojohansen10-Oct-12 4:10
dojohansen10-Oct-12 4:10 
GeneralRe: Application efficiency? Pin
Eddy Vluggen10-Oct-12 8:30
professionalEddy Vluggen10-Oct-12 8:30 
GeneralRe: Application efficiency? Pin
dojohansen10-Oct-12 23:15
dojohansen10-Oct-12 23:15 
QuestionRe: Application efficiency? Pin
Eddy Vluggen10-Oct-12 23:49
professionalEddy Vluggen10-Oct-12 23:49 
AnswerRe: Application efficiency? Pin
dojohansen11-Oct-12 0:10
dojohansen11-Oct-12 0:10 
GeneralRe: Application efficiency? Pin
Eddy Vluggen11-Oct-12 0:41
professionalEddy Vluggen11-Oct-12 0:41 
GeneralRe: Application efficiency? Pin
jschell23-Sep-12 7:15
jschell23-Sep-12 7:15 
GeneralRe: Application efficiency? Pin
dojohansen10-Oct-12 3:28
dojohansen10-Oct-12 3:28 
AnswerRe: Application efficiency? Pin
jschell23-Sep-12 7:46
jschell23-Sep-12 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.