On Feb 7, 2010, at 9:38 AM, sim wrote:

> Lets say I have a 3 tables: Products, Users and UserProducts.
> UserProducts has 2 FKs , ProductID and UserID, showing which products
> are used by which user.
> I create 3 bizobjs, one for each table.
> Should UserProducts be a child of Users or Products?

        Think about it this way: which table do you want to browse 
independently? That will determine which table's values are dependent on the 
independent table's current record. 

        I'm assuming here that UserProduct is a M:M intermediate table, 
commonly called an allocation or cross-reference table. 

        Let's say you want to browse the Products table and see all the Users 
records that are related to the current Product, then UserProduct would be a 
child of Product, because its values are dependent on the current Product 
record. The User table would then be dependent on the current record in 
UserProducts, so it would be a child of UserProducts.

        But if you are browsing by user, and want to see the products that they 
have, you would reverse things: Users would be the independent table; 
UserProducts would be a child of that, and Products would be a child of 
UserProducts.

        This is standard relational table theory, not anything specific to 
Dabo. The bizobj relations in Dabo are designed to reflect typical relational 
designs.

        Does this make things any clearer?


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to