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

Object Design and CslaGeneratorFork

Dec 22, 2014 at 10:40 PM
Edited Dec 22, 2014 at 10:45 PM
I am just curious about how to best handle the following scenario with CslaGeneratorFork.

I have the typical Entity table with 2 possible subtables. Either it is a legal entity or a Person. Each one of these has separate Subtables.

Should the person object be a child object inside Entity? I did try that, but the generators outcome makes me think this is probably a design flaw.

What happens in 1:1 parent/child relationships?

for example i also use the Entity table in a 1:1 relationship with the Clients table. Should they be handled using that realtionship, or handled as separate root objects? (foreign keys exist on tables ofc)
Dec 22, 2014 at 11:22 PM
Hi Pandelaras,

First of all, the generator is not a design validator. So its outcome shouldn't be used as guidance about design.

Second, I don't think I understood your point. Maybe it would be easier if you explain the object design instead of discussing tables.

I understood you have an entity that can be a costumer or a <fill in A>
A customer has a list of <fill in B>
while <fill in A> entity type has a list of <fill in C>

Depending on what is on the <fill in ...> fields, it would be easier to understand what both entity types have in common so they should go into the same Entity table.
Dec 23, 2014 at 6:50 AM
Hi Tiago,

As a user of this generator i would like to thank you for your good work. I have also studied your articles on codeplex and here concerning object design

The relationship i am trying to track is like this.

i have an entity that can be a customer or a <fill in A>. The customer then can have a list of <fill in B>. All the common fields of these object are already on the same entity table. I know how to track the relationship of the list of <fill in B>. I was wondering whether <fill in A> should be implemented using a root/child object or is this a design error from my part.

In my scenario i have entities objects which use a common table for all the data fields i want to track, but based on the scenario i may need extra information which is stored on another table. for example the customer needs extra information to be described and these are stored on another table and object.
Dec 23, 2014 at 10:13 PM
Edited Dec 23, 2014 at 10:13 PM
Doing a fast search on csla forum i ended up back with the basics. That is "we are modelling the behavior and not the relationship". So although there are 2 tables i am supposed to create only one object. Ill give it a try :)