Complex BO question


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 have a complex BO that contains a number of additional BOs.  For simplicity, my complex BO is called MainBO which instantiates _BO1, _BO2 and _BO3 (these are private BOs contained within MainBO).  _BO1 has columns called test1, test2, and test3.  _BO2 has columns called test4, test5 and test6.  _BO3 has columns called test7 and test8.  I have exposed these columns through Custom Field Properties and each is bound to a form.  Each is populated through a scalar query executed during the Custom Field's Property Get procedure.  The form only has MainBO dropped on it.  When running the form, as I navigate through records everything works perfectly.  When I click the edit toolstrip button, all of these fields become editable.  If I edit fields that were originally part of MainBO, the values save properly.  If I edit the fields exposed through MainBO such as test1, the Property Set procedures work perfectly.  The problem is that clicking the save button causes Property Gets to fire, so the new values for test1 - test8 get reset to their original values before they can be saved.  I am trying to save these secondary BOs in the BeforeSave event for MainBO, but by the time that code executes, the values for test1 - test8 have already been reset.

Is putting the code to retrieve the appropriate values for the secondary BOs in Property Get procedures a bad idea?  If so, where should that code be placed?  Better yet, is this the approach I should be using?

I'm not sure if it makes a difference but I'm using the StrataFrame Maintenance form so the initial save to MainBO is called through the MaintenanceFormToolStrip.

To complicate this further, what if the records I want to retrieve from _BO2 and _BO3 are dependent on values from _BO1?  Basically, MainBO and _BO1 can be thought of as a logical "record" although the values are spread across two tables (and I cannot redesign the db).  The only keys defined in the database are primary keys for each table represented by the BOs.  There are no foreign keys defined in the database-- all of the fk relationships are managed by existing software code.  I need to be able to save values first to _BO1 and then to MainBO, and each of these may contain lookup values that correspond to columns in _BO2 and _BO3.

This is my first complex BO in the real world, so once I am able to get past this hurdle I will test the Add/Delete functionality and if everything works I'll be able to use this as a model for other complex BOs.

Thanks,

Michael Cobb

Reply
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
OK I think that will work but I have another question.  Where is the best place to put the fill code for a secondary BO like _BO1?  This business object needs to be filled with data so that the MainBO can expose some of its fields through Custom Field Properties.  Keep in mind that there are additional secondary BOs like _BO2 that are dependent upon the data in _BO1, and fields from _BO2 are also exposed through Custom Field Properties in MainBO.

Thanks!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Michael Cobb - 18 Years Ago
StrataFrame Team - 18 Years Ago
Michael Cobb - 18 Years Ago
Michael Cobb - 18 Years Ago
StrataFrame Team - 18 Years Ago
Michael Cobb - 18 Years Ago
StrataFrame Team - 18 Years Ago
Michael Cobb - 18 Years Ago
StrataFrame Team - 18 Years Ago
Michael Cobb - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Michael Cobb - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Michael Cobb - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search