Can I implement a CollectionObject with other CollectionObjects as its child

Can I implement a CollectionObject with other CollectionObjects as its child

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


BillSun posted on Monday, July 30, 2007

I have a case which I need to implement a collectionObject which contains otherCollectionobjects.

for example, a table named RuleAction with the following columns

   1. RuleCategoryID   varchar(16) not null

   2. RuleID  varchar(16)  not null

   3. SequenceNum  int not null

   4. actionID      varchar(16)

The primary key are (RuleID, SequenceNum)

using clsa, I can create two editable classes: RuleAction(EditableChild), RuleActions  (EditableChildCollection). RuleActions has a property of RuleID which means an instance of RuleActions must always have a ruleID associated with it. within this collection under a ruleID, implemented some business logic.

However, I need another collection object which has RuleCategoryID as its property, and contains many of the RuleActions objects.

How can I implemented the last class by using csla framework. or just create a list of RuleActions class?

 

 

RockfordLhotka replied on Tuesday, July 31, 2007

It sounds like you may be designing your object model based on your data structure, which is a problem.

What is your use case? What purpose do the objects serve in that use case? What is their responsibility (each object should have only one)?

Copyright (c) Marimer LLC