Getting Started

Getting Started

Old forum URL: forums.lhotka.net/forums/t/6840.aspx


Frazer posted on Thursday, April 23, 2009

I am quite new to using CSLA - and I am a little bit confused with how to choose which base classes to use and how related child collections are represented in the properties of business objects.

For example, lets say I have the following business object candidates:

RequestPackage - this object represents a request batch that is created by a user, fulfilled and managed as a aggregate work package.  Sample properties would include:

RequestPackageID
UserID
RequestPackageName
Requests
etc. 

Each RequestPackage consists of one or more Requests.  A Request is a single fulfillment request (like a line item on an order).  My question is: what is the appropriate class structure to implement the Requests collection property in the RequestPackage class?  Is something like this correct:

1.  Implement RequestPackage as an editable root
2.  Implement RequestPackage.Requests as an editable child collection of Request
2.  Implement Request as an editable child

 

thanks,

Frazer

 

RockfordLhotka replied on Thursday, April 23, 2009

That is probably correct. Just remember to model your objects around the use case (more or less around the UI) and not around the database structure and you'll have better results.

Make sure to read at least the first 5 chapters of the Expert 2008 Business Objects book, as they'll answer a lot of this type of question.

Copyright (c) Marimer LLC