ReadOnly Lists vs. Editable Lists

ReadOnly Lists vs. Editable Lists

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


Wbmstrmjb posted on Thursday, September 18, 2008

We are struggling with a concept that is probably very simple to understand by most of you.  We have a common need for a list of items where the items themselves cannot change.  For instance, attaching a list of ZipCodes to a County.  It seemed logical that the list would be editable and the objects in the list would be readonly.  This obviously is not true, so then we realized that the objects themselves would be the ones making the "link", so they were in fact editable.  This meant we thought it should be a readonly list of editable items since you can add and remove items from a readonly list and that is what we'd be doing, but this isn't true because you cannot call "Save" on a readonly list and thus could make the assignments.  I turned to PT for guidance and the lists are editable and the objects within them are editable.

So my question is, can someone give an explanation on when each combination should be used for a ReadOnly List of Editable objects, ReadOnlyList of ReadOnly objects, EditableList of Editable objects (I know that you cannot have an Editable List of ReadOnly objects)?  My understanding is the following:

ROList of Editable for ?

ROList of RO for information purposes like displaying a list of assigned resources to a project.

EditableList of Editable for making changes to a list and the children in a list.

 

ajj3085 replied on Thursday, September 18, 2008

Usually this would be done via a root BLB subclass, which BB objects contained inside.  It's ok that they don't have any property setters in the BB subclass...

Editable means the instance can change data in the database.  Readonly means the instance can't change the data in the database.. so there's no need to support n-level undo, Save, validation rules, etc.

Copyright (c) Marimer LLC