ReadOnly And/Or Editable Business Objects

ReadOnly And/Or Editable Business Objects

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


anna posted on Saturday, October 20, 2007

I have a design question related to a Survey-like application that has (among other classes) two BusinessCollectionBase-derived classes for Questions and Answers and two BusinessBase-derived classes for individual Question & Answer objects.

There are two applications that will interface to this business-layer; one that is purely read-only and will present the survey to the user and collect responses. The other is a management application to create surveys.

In such a case, should I design two sets of business objects (read-only and editable) or simply design editable objects and have both applications interface to them. Will there be a significant difference in performance?

Thank you.

 

JoeFallon1 replied on Sunday, October 21, 2007

I would create the right object for the right use case.

So for the Read Only scenario I would use a ROC. (It is lighter weight and does not contain validation rules.)

I would use Editable objects for the other scenario.

Joe

 

anna replied on Monday, October 22, 2007

Thanks very much. I am convinced of that now; I've been reading a few other posts and a use-case based design seems like the right way to go.

DavidDilworth replied on Tuesday, October 23, 2007

As you get further into your project, you will probably find that you frequently need two copies of most entities - an Editable one and a ReadOnly one.  This is normal in a CSLA environment.

Copyright (c) Marimer LLC