Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple tables in BizObj?
Message
 
To
02/04/2009 14:01:51
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01392599
Message ID:
01393170
Views:
55
Sam, This may be a matter of semantics but I'll try to clarify. I have one back end table named Staff, as you said. In the business object, I have a method that returns a dataset, filling a specified TableName for that dataset for each category of staff. It's confusing because the Table reference in the business object is not referring to the back end table but to a discreet table, similar to an alias in FoxPro, within the business object's dataset. It took me a while to get my mind around it but it has proven quite useful. You can update the same back end table from each of the dataset's tables. The business form's Save method has a parameter to specify the table name. As another example, I have a notes file. Some notes are just information and some are assignments. I do the entry of the assignments using a separate table from the information notes because the users wanted a different interface on a separate tab of the same form. It works quite nicely.

When I need to reference another back end table in a business object, I use a reference to the business object for that other back end table. For instance, I have a form that has a sort of posting process. Once certain fields are filled in, when the row is saved, I also want to create a row in another table. I usually put that sort of thing in a HookPostSave method override.

I hope this helps.
Linda

>>>In the developers guide there are several references to having multiple datatables in a single business object. Can anyone give me a real world example of when I might want to do this? Would all of the datatables be updateable? What about child business objects of that single parent business object? It all seems very confusing and so far I cannot think of a real world use for this feature.
>>
>>The simplest example I have is a form where there are several combo boxes based on the same business object. In one application, we need to assign a claims contact person, a nursing contact person and a social work contact person. All of those people are included in the staff table but I only need a subset of that for each combo box. Thus, I create a method to create the dataset for each combo box and pass in a parameter for the type of contact and the table name. I hope that's helpful.
>
>Thanks Linda for your attempt to help me learn something new. I am trying to get my brain around your example. If I understand correctly, conceptually you have a backend table named Staff and a related Staff business object. In the Staff business object you have a method that returns a DataSet based on the desired type of contact from the Staff backend table. So based on your example needs, you have 3 different DataSets that the same business object can manipulate by switching among the DataSets. All 3 DataSets still relate to 1 backend table.
>
>Questions: Could multiple DataSets retrieved from the same backend table all be used to update the table? If so, how would you call the Save method etc. Your example uses only 1 backend table, but I wonder if there is a real world need for using multiple backend tables in 1 business object?
>
>I am struggling to get the big picture of the Mere Mortals framework. Any help is appreciated.
>
>Sam
Linda Harmes
HiBit Technologies, Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform