This project has moved and is read-only. For the latest updates, please go here.

Allow multiple parents for children

Mar 8, 2011 at 3:24 PM

Hi Charleh

[quoting Charleh]

Allow multiple parents for children either by interface or by multi-parent dataportal methods

If this is already done by the object relation builder, then I apologise as I've not really got to grips with it yet.

Nobody likes creating multiple objects which do the same thing - take for example a 'notes' collection which takes two keys 'ID' and 'Area'. The best way I can get CSLAGenFork to represent my objects correctly is to add an interface as an object and then create my child 'notes' collection which has the interface as it's parent. It's a hack but it works. When this is done, all you need to do is add a new child collection property to your objects and make sure it's of the correct type (childnotecollection), and also make sure the object implements the interface.

[end of quote]

On this question, please refer to a very recent forum thread. Csla object structure isn't supposed to allow for children to have multiple parents.

Having said that, I think you are talking about something that is quite common on any business application: different objects contain children of the same basic type. By basic type I mean the same behaviour but also the same data. 

Does CGF allows some way to do it without editing the generated code? If so, I presume there is room for improvements. Can you send a sample CGF project?