Persistent Objects and ObjectLists

From: Shane Mingins (shanemingins_at_yahoo.com.clothes)
Date: 10/15/03


Date: Wed, 15 Oct 2003 15:44:00 +1300

Hi

In many examples illustrating OO principles/ideas etc I have seen the Model
part of the illustration implemented as a List or "ObjectList" e.g.
EmployeeList containing a list of Employees.

So creating an Employee would have the EmployeeListEditor create a new
Employee and pass it to the add() method on the EmployeeList.

I have also seen these examples persist the EmployeeList when they show how
to use Persistence.

Now I realise that these are simple examples used to illustrate the point in
hand (and they do this extremely well) but it leaves me a bit confused about
the use of the List and ListEditor type Classes.

In an Enterprise Application I would envisage that when I create an Employee
and click the Save button that the Employee object created would be
persisted. Correct?

Now would the EmployeeList then be refreshed utlimately from the persistence
layer? I would have thought so. IOW I view the EmployeeList to be a
representation of persisted employees.

And then if it is, alot of the examples (as outlined above) of ObjectList
that I see have methods on them that are not really required .... for
example would I necessarily need that add/remove methods for the list if all
ever do is load it entirely from the persisted Objects.

How does that all sound?

Shane

-- 
shanemingins@yahoo.com.clothes
remove clothes before replying
"It is not the strongest of the species that survive, nor the most
intelligent, but the one most responsive to change." --- Charles Darwin