General question about object model

General question about object model

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


Holger posted on Tuesday, August 18, 2009

Hi there,

I have a general question:
In our system we have an article overview screen and an article edit screen.

The difference between the overview and the edit screen are
Overview: is multirow, has less properties and less child lists than edit.
Edit: has validation, is a single article object with attached child object lists.

Both objects have more or less the same child objects (Lists and Non Lists), but
we have some different requirements on the overview screen, e.g. display more values in one row and
allow extended filtering of articles with many different parameters which generate dynamic SQL.
The edit screen should generally show more values and attached child-lists than the overview.
The overview screen should show about 1000 - 2000 articles as rows.

What’s the recommended practice, should we make:
A) Two Versions, a readonly for the overview (+filtering)  and an editable for the edit, e.g.: A readonly list of readonly objects and their readonly childs (list and non list objects) for the overview and
additional an editable root object with editable childs for the edit screen?

B) Just one editable list of editable business objects and their child objects which serves for both,
the overview (+filtering) and the edit?

C) Do you have a complete different design idea?

We are aware that:
Version A) would prevent edits in the overview and version B)  would led to a more complex object.

What’s better and why?

And what about performance and memory usage? Is the readonly base class faster and consumes less memory than the business base class?

Kind regards
Holger

ajj3085 replied on Tuesday, August 18, 2009

So you can edit overview records, and also have a "full" edit screen?

In that case it sounds like you should have two seperate sets of classes (the overview ones and the full edit ones), but they can all be editable. If certain parts of the overview cannot be changed, thats fine... you can still have read-only properties on a BusinessBase subclass, if for example it contains a subrecord that needs to have editing capability.

HTH
Andy

Holger replied on Wednesday, August 19, 2009

Hi Andy,

thanks for your answer. I agree with your solution separating these two scenarios.

We are not sure at the moment, if we want to allow editing data in the overview. There are different kinds of articles with a certain state in the overview list. It seems to me that we have to implement a difficult state management for the edit scenario.

Bye

Holger

Copyright (c) Marimer LLC