Parent - Child - Child relation implementation

Parent - Child - Child relation implementation

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


Satish posted on Wednesday, April 15, 2009

Hi All,

I am new to CSLA.NET, I am trying to implement a strange relation don;t know how to handle this any help is appritiated

Tables - Primary Key - Foreign keys
Emp - IdEmp - None
Address - IdAddr - None
Emp-Addr - IdEmpAddr - IdEmp, IdAddr

I created Base class as Emp and child classlist as AddrList and Child class as Addr, Don't know how to handle EmpAddr

Thanks
Satish

RockfordLhotka replied on Monday, April 20, 2009

You should make sure you are designing your objects for your use case, not to reflect the shape of your database. It is very likely that you are designing your objects to look like your tables, when you should be designing them to match the needs of the UI or use case.

In other words, most Child-Child relationships are the result of data-centric thinking, and are just a flawed object model.

Copyright (c) Marimer LLC