Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: Business Objects Pin
Colin Angus Mackay16-Jan-09 15:17
Colin Angus Mackay16-Jan-09 15:17 
GeneralRe: Business Objects Pin
Jon Rista16-Jan-09 15:26
Jon Rista16-Jan-09 15:26 
GeneralRe: Business Objects Pin
N a v a n e e t h16-Jan-09 15:34
N a v a n e e t h16-Jan-09 15:34 
GeneralRe: Business Objects Pin
Jon Rista16-Jan-09 15:40
Jon Rista16-Jan-09 15:40 
GeneralRe: Business Objects Pin
CodingYoshi16-Jan-09 17:20
CodingYoshi16-Jan-09 17:20 
GeneralRe: Business Objects Pin
Jon Rista16-Jan-09 17:32
Jon Rista16-Jan-09 17:32 
GeneralRe: Business Objects Pin
CodingYoshi16-Jan-09 20:23
CodingYoshi16-Jan-09 20:23 
GeneralRe: Business Objects Pin
Jon Rista16-Jan-09 20:31
Jon Rista16-Jan-09 20:31 
Yes, I mean all of the persistance related stuff, his undo/redo stuff, etc. on his objects, which includes Dirty, Deleted, New, Save(), Delete(). Those are what we call "persistance concerns"...they represent a certain set of functionality and state that has nothing to do with the business, and everything to do with managing updates of data in a database. That blends the concerns of your business classes, which violates the principals of Single Responsibility (SR) and Separation of Concerns (SoC). These two principals are critical to creating maintainable software...software that has cohesive, properly-coupled components without reducing the isolation of specific kinds of functionality.

CSLA creates an object model that is really convenient to use as a developer...having implemented it myself once, I liked the ability to save a business object just by calling .Save(). But I learned some really hard lessons on that project, especially the lesson about SR and SoC. Despite having used CodeSmith heavily on that project, the maintainability of such a coupled and blended architecture is atrocious. Even if you just have a .Save() method on a business entity that calls out to DAL classes that actually implement the operation...that business entity (and quite probably a specialized entity-specific collection class) are still tightly coupled to the DAL, and when the DAL changes, so do all the objects that rely on it. The problem is only compounded by cross-sampling behavior between related entities...such as having Customer also save its Orders when you call its .Save() method...take that a few degrees farther and you can probably see the nitemare for yourself.

By following DDD patterns and principals, you keep the vast bulk of your classes loosly coupled, and aggregate the bulk of "orchestration" logic...logic that blends all those various concerns together to implement a process...into services. Such an architecture is much easier to change, as there is one, and only one, location to go to in response to changes in your DAL, entities, or support types (i.e. factories).

Single Responsibility[^]
Separation of Concerns[^]
GeneralDomain Driven Design Quickly - free ebook Pin
DaveyM6917-Jan-09 2:22
professionalDaveyM6917-Jan-09 2:22 
GeneralRe: Domain Driven Design Quickly - free ebook Pin
CodingYoshi17-Jan-09 13:17
CodingYoshi17-Jan-09 13:17 
AnswerRe: Business Objects Pin
Mark Graham26-Feb-09 23:43
Mark Graham26-Feb-09 23:43 
Questiondisplay data from a database in a label Pin
ferronrsmith16-Jan-09 10:21
ferronrsmith16-Jan-09 10:21 
AnswerRe: display data from a database in a label Pin
Alaric_16-Jan-09 10:25
professionalAlaric_16-Jan-09 10:25 
GeneralRe: display data from a database in a label Pin
ferronrsmith16-Jan-09 11:24
ferronrsmith16-Jan-09 11:24 
GeneralRe: display data from a database in a label Pin
ferronrsmith16-Jan-09 11:25
ferronrsmith16-Jan-09 11:25 
GeneralRe: display data from a database in a label Pin
CodingYoshi16-Jan-09 12:50
CodingYoshi16-Jan-09 12:50 
QuestionString representation of an object's property name Pin
Alaric_16-Jan-09 10:11
professionalAlaric_16-Jan-09 10:11 
AnswerRe: String representation of an object's property name Pin
TommyTomToms16-Jan-09 10:44
TommyTomToms16-Jan-09 10:44 
GeneralRe: String representation of an object's property name Pin
Alaric_16-Jan-09 10:55
professionalAlaric_16-Jan-09 10:55 
GeneralRe: String representation of an object's property name Pin
Jon Rista16-Jan-09 11:47
Jon Rista16-Jan-09 11:47 
GeneralRe: String representation of an object's property name Pin
Alaric_16-Jan-09 13:43
professionalAlaric_16-Jan-09 13:43 
QuestionHi peoples, Pin
Hema Bairavan16-Jan-09 7:07
Hema Bairavan16-Jan-09 7:07 
AnswerRe: Hi peoples, Pin
Thomas Stockwell16-Jan-09 7:47
professionalThomas Stockwell16-Jan-09 7:47 
QuestionNewbie question about TreeNodeCollection vs TreeNode Pin
Rafone16-Jan-09 5:11
Rafone16-Jan-09 5:11 
AnswerRe: Newbie question about TreeNodeCollection vs TreeNode Pin
Wendelius16-Jan-09 7:54
mentorWendelius16-Jan-09 7:54 

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.