Click here to Skip to main content
15,886,006 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
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 
I am hopeful that your question is confused rather than you and or whoever is providing this information to you.

Retrieving data from a database is a relatively expensive operation. Period. Doesn't matter why you do it. That however doesn't mean that you can retrieve it once only. The business needs drive in what way it can be retrieved.

You put database code in a database layer because that has multiple benefits. You don't put database code outside the database layer because doing that completely violates the point of having the database layer in the first place.

And notice that nothing in the above has anything to do with stateful or stateless.


CsTreval wrote:
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'.


As a general statement that is nonsense.

Implementing code for real businesses is not clean. You attempt to create well crafted code but only to the extent that it makes sense to meet the needs of the business.

Other than that I can only suppose that you did something really wrong in terms of service separation and database layer separation and that point was being emphasized.

The database layer should to database stuff. The service layer should do service layer stuff. Again normally, not exclusively.


And note that none of this has anything to to with the general topic of object creation. Nor with performance.


CsTreval wrote:
Create it once there and let the rest of the application access its instance later. Do not create this instance upon every call.


As stated generally nonsense.

It depends on what the object does. I don't need to retrieve the database connection string on every call. There is however no point in not creating a StringBuilder on every call.
QuestionMultiple Versions Of Application Pin
Matt U.20-Sep-12 7:07
Matt U.20-Sep-12 7:07 
AnswerRe: Multiple Versions Of Application Pin
Pete O'Hanlon20-Sep-12 7:27
mvePete O'Hanlon20-Sep-12 7:27 
GeneralRe: Multiple Versions Of Application Pin
Matt U.21-Sep-12 8:10
Matt U.21-Sep-12 8:10 
AnswerRe: Multiple Versions Of Application Pin
jschell20-Sep-12 8:59
jschell20-Sep-12 8:59 
GeneralRe: Multiple Versions Of Application Pin
dojohansen10-Oct-12 4:59
dojohansen10-Oct-12 4:59 
AnswerRe: Multiple Versions Of Application Pin
Expert Coming20-Sep-12 14:20
Expert Coming20-Sep-12 14:20 
GeneralRe: Multiple Versions Of Application Pin
jschell21-Sep-12 10:30
jschell21-Sep-12 10:30 
GeneralRe: Multiple Versions Of Application Pin
Expert Coming24-Sep-12 8:24
Expert Coming24-Sep-12 8:24 
QuestionMake everything a tree? Pin
Leslie Sanford18-Sep-12 7:28
Leslie Sanford18-Sep-12 7:28 
AnswerRe: Make everything a tree? Pin
jschell18-Sep-12 9:01
jschell18-Sep-12 9:01 
GeneralRe: Make everything a tree? Pin
Ravi Bhavnani25-Sep-12 7:19
professionalRavi Bhavnani25-Sep-12 7:19 
QuestionSearching for a frmework or Library for managing documentsa Pin
NH7116-Sep-12 22:52
NH7116-Sep-12 22:52 
AnswerRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen17-Sep-12 0:00
professionalEddy Vluggen17-Sep-12 0:00 
GeneralRe: Searching for a frmework or Library for managing documents Pin
NH7117-Sep-12 0:37
NH7117-Sep-12 0:37 
GeneralRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen17-Sep-12 0:49
professionalEddy Vluggen17-Sep-12 0:49 
GeneralRe: Searching for a frmework or Library for managing documents Pin
dojohansen10-Oct-12 4:23
dojohansen10-Oct-12 4:23 
GeneralRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen10-Oct-12 8:48
professionalEddy Vluggen10-Oct-12 8:48 

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.