in reply to OO Application Design
I believe you should have getAdults as a class method in class Person and let it return an object of type PersonList. A PersonList should just contain the handle of the executed statement (in other words a cursor or ResultSet) and wouldn't hold all elements in memory. It could have methods like get_next, has_more_elements, as_array, letting you either access elements sequentially or get all the bunch as an array.
In a more general setting, a PersonList could be an instance of a superclass DBObjectList, knowing aware of what kind of objects it is retrieving (in your case Person's).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OO Application Design
by Nomad (Pilgrim) on Sep 26, 2002 at 07:28 UTC |