General information
Category:
The Mere Mortals .NET Framework
Title:
Designing bizobjects to use lookup tables
Environment versions
Network:
Windows 2003 Server
Hi all,
I have a design question regarding how to handle database tables that use a lot of lookup tables. From what I understand, the MM framework is great at handling master/detail relationships but I am having trouble finding a nice way to handle lookup tables.
What I need is "best practice" way of designing my business objects that retrieve and modify data in tables that have a lot of foreign key columns as well as other data columns.
If the data was read-only then I would just create a view or stored procedure that joins (resolves) the table to all its lookup tables and display them to the user. The problem is that our program allows users to add and modify the rows as well.
My idea 1 : Have two tables in my business object. The default table would contain just the columns of the table (mostly foreign key columns). This default datatable would be used to add/modify rows (I'm thinking using a mmPicker to add foreign keys to the default datatable) The bizobj's second datatable would use a database view which joins the database table to all its lookup tables. This the bizobj's second datatable would be used to display data in a read-only fashion.
My idea 2 : Use just a database view that joins the table to its lookup values but also contains all the foregin key columns and just perform updates on this database view.
Does anyone know of a better way of doing this. I'm open to using stored procedures aswell.
Andrew
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only