BO Design - Best Practice


Author
Message
Michael Cobb
Michael Cobb
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 26, Visits: 1K
I'm new to StrataFrame.

My company has created and compiled BOs as one BO per database table.  I'm designing a single form that has to retrieve data from seven different tables, so there are seven BOs on the form.  It would be very difficult to have multiple versions of a table-based BO with the same parent but different child BO objects.  Because of this, none of these BOs are related to any of the others by the Parent-Child relationship properties. 

The form uses a primary BO and passes parameters from the main BO to the other six BOs to retrieve lookup values for fields on the form.

I see that in your tutorials/samples that the BOs are table-based.

As a developer, I have to put a lot of extra code at the form level to update all of the fields on the form that use data coming from the BOs that are not the primary BO.

It seems that it would be easier to base the form on a single database view that already contains the main table values and the lookup values - this way all of the business logic and data can reside in a single instance of a single BO.  This would also reduce the amount of form level code by a large amount.

What is the recommended best practice for designing and creating BOs-- view-based or table-based?

Thanks!

Reply
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Unless I'm completely missing the point here, I'd likely just drop the 7 BOs on the form.



Make the primary one the primary BO of the form. I'd set the form's IncludeInForm... properties (e.g. IncludeInFormSaveType, etc) to AllBusinessObjects.



Then you a few lines in the primary BO's Navigated event to load the other six BOs.



Controls bound to the appropriate BO/field.



The last bit would be to programatically tie the six to the primary BO by setting the appropriate FKs, usually in the AddNew event for each BO.



Then this will allow you to use the maintenanceformtoolstrip, add/edit/save/undo/delete from all at once.



Of course, I could be missing something and this wouldn't work....Blink
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search