Click here to Skip to main content
12,765,241 members (37,585 online)

Design and Architecture

 
GeneralRe: Application efficiency? Pin
Eddy Vluggen10-Oct-12 9:30
memberEddy Vluggen10-Oct-12 9:30 
GeneralRe: Application efficiency? Pin
dojohansen11-Oct-12 0:15
memberdojohansen11-Oct-12 0:15 
QuestionRe: Application efficiency? Pin
Eddy Vluggen11-Oct-12 0:49
memberEddy Vluggen11-Oct-12 0:49 
AnswerRe: Application efficiency? Pin
dojohansen11-Oct-12 1:10
memberdojohansen11-Oct-12 1:10 
GeneralRe: Application efficiency? Pin
Eddy Vluggen11-Oct-12 1:41
memberEddy Vluggen11-Oct-12 1:41 
GeneralRe: Application efficiency? Pin
jschell23-Sep-12 8:15
memberjschell23-Sep-12 8:15 
GeneralRe: Application efficiency? Pin
dojohansen10-Oct-12 4:28
memberdojohansen10-Oct-12 4:28 
AnswerRe: Application efficiency? Pin
jschell23-Sep-12 8:46
memberjschell23-Sep-12 8: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 8:07
memberMatt U.20-Sep-12 8:07 
AnswerRe: Multiple Versions Of Application Pin
Pete O'Hanlon20-Sep-12 8:27
protectorPete O'Hanlon20-Sep-12 8:27 
GeneralRe: Multiple Versions Of Application Pin
Matt U.21-Sep-12 9:10
memberMatt U.21-Sep-12 9:10 
AnswerRe: Multiple Versions Of Application Pin
jschell20-Sep-12 9:59
memberjschell20-Sep-12 9:59 
GeneralRe: Multiple Versions Of Application Pin
dojohansen10-Oct-12 5:59
memberdojohansen10-Oct-12 5:59 
AnswerRe: Multiple Versions Of Application Pin
Expert Coming20-Sep-12 15:20
memberExpert Coming20-Sep-12 15:20 
GeneralRe: Multiple Versions Of Application Pin
jschell21-Sep-12 11:30
memberjschell21-Sep-12 11:30 
GeneralRe: Multiple Versions Of Application Pin
Expert Coming24-Sep-12 9:24
memberExpert Coming24-Sep-12 9:24 
QuestionMake everything a tree? Pin
Leslie Sanford18-Sep-12 8:28
memberLeslie Sanford18-Sep-12 8:28 
AnswerRe: Make everything a tree? Pin
jschell18-Sep-12 10:01
memberjschell18-Sep-12 10:01 
GeneralRe: Make everything a tree? Pin
Ravi Bhavnani25-Sep-12 8:19
memberRavi Bhavnani25-Sep-12 8:19 
QuestionSearching for a frmework or Library for managing documentsa Pin
NH7116-Sep-12 23:52
memberNH7116-Sep-12 23:52 
AnswerRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen17-Sep-12 1:00
memberEddy Vluggen17-Sep-12 1:00 
GeneralRe: Searching for a frmework or Library for managing documents Pin
NH7117-Sep-12 1:37
memberNH7117-Sep-12 1:37 
GeneralRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen17-Sep-12 1:49
memberEddy Vluggen17-Sep-12 1:49 
GeneralRe: Searching for a frmework or Library for managing documents Pin
dojohansen10-Oct-12 5:23
memberdojohansen10-Oct-12 5:23 
GeneralRe: Searching for a frmework or Library for managing documents Pin
Eddy Vluggen10-Oct-12 9:48
memberEddy Vluggen10-Oct-12 9: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.


Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 21 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid