We are designing an object model from scratch for an application that will expose data via WCF. We are wondering about how to handle the case where objects that have a collection of objects within them. For example, a contact object with a collection of address objects.
contact - list<address>
Should we have a wrapper object, something like "AddressCollection", that has properties of its own like "hascollectionloaded", for lazy loading of the collection, and other things we havn't thought of yet, or should we just rely on the list<> as above?
contact - AddressCollection - list<address>
- hasBeenFullyLoaded
- preferredObjectLoaded
- somethingElsePertinent
For the example above, could we let the AddressCollection inherit from an abstract base class or interface implementing the "hasbeenloaded" and "somethingElsePertinent" properties?
OR, even implement another bool property on the contact object itself "hasaddressloaded".
contact - list<address>
- hasaddresscollectionloaded
Likewise, how to implement a custom object on the Contact that isn't necessarily a collection? For example:
Contact - Status
OR
Contact - StatusObject - Status
- hasStatusLoaded
- somethingElseWeWantToKnow