Object Model question

Object Model question

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


bnair posted on Thursday, June 15, 2006

Hi All,

I am working on CSLA 2.0 and I am running into object model design issues.

I am building an address book module..

I have the following classes

AddressBookContact - Editable Root
AddressBookContactList - Editable Root Collection

AddressBookGroup - Editable Root
AddressBookGroupList - Editable Root Collection

When I fetch the AddressBookContact object I need all the groups that the contact belongs.Do I need to make AddressBookGroup and AddressBookGroupList as switchable objects

ALso ,when I fetch the AddressBookGroup object I need all the contacts that are in the group.In that case I need the ContactList collection..

How would I model this efficiently without ending up creating a lot of redundant root and child classes?

--bnair


 

hurcane replied on Thursday, June 29, 2006

Your model sounds exactly like Rocky's example in the Project Tracker.

AddressBookContact = Resource
AddressBookContactList = ResourceList

AddressBookGroup = Project
AddressBookGroupList = ProjectList

Read pages 330-339 for a very good answer on how to handle this scenario.

Copyright (c) Marimer LLC