﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Question: Original BO and subsequent copies</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 14 Sep 2026 11:43:16 GMT</lastBuildDate><ttl>20</ttl><item><title>Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7506.aspx</link><description>a) I create a BO in a project and then I build the project. The BO appears on the Toolbox.&lt;br&gt;
b) I then place a copy of the BO from Toolbox and put on my form.&lt;br&gt;
c) I add some events to the original BO.&lt;br&gt;
d) I add some events to the copy of my BO on the form.&lt;br&gt;
&lt;br&gt;
Is it the correct understanding that SF will always execute the event's codes on the original BO first and then on any subsequent BO that were placed on the forms?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Mon, 19 Mar 2007 12:13:04 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7590.aspx</link><description>[quote]We fixed the RegEx string that InstantASP was using so the quote and CodeSnippet will now work.[/quote]&lt;br&gt;
&lt;br&gt;
[codesnippet]MessageBox.Show("Cool! This didn't used to work!")[/codesnippet]</description><pubDate>Mon, 19 Mar 2007 12:13:04 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7589.aspx</link><description>[quote]Just got off the phone with an old friend who is also switching from Delphi to C# and I told him how much he will need SF for darabase development. He or his company might be joining us soon!&lt;FONT size=1&gt;&lt;BR&gt;&lt;/FONT&gt;[/quote]&lt;/P&gt;&lt;P&gt;This is great news!</description><pubDate>Mon, 19 Mar 2007 12:01:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7588.aspx</link><description>Thanks for the fix and I do see your point about the "Edit" feature which you loose trace of what has been said before. It's no big deal, worst come to worst, we can add another post to follow it up.&lt;br&gt;
&lt;br&gt;
Just got off the phone with an old friend who is also switching from Delphi to C# and I told him how much he will need SF for darabase development. He or his company might be joining us soon!</description><pubDate>Mon, 19 Mar 2007 11:59:37 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7578.aspx</link><description>We fixed the RegEx string that InstantASP was using so the quote and CodeSnippet will now work.&amp;nbsp; As for the edit, we have intentionally not allowed this.&amp;nbsp; We have discussed allowing you to edit your own posts...but there are some concerns with this as well.&amp;nbsp; We would have to constantly monitor the edits as well as the new entries.&amp;nbsp; New entries are easy to monitor, but edits would require that we continually go back and make sure that previous posts are not being changed illegitamtely (going back and making changes that change the downstream posts and/or to post incorrect or invalid information)...which with 99% of the forum users this would not be an issue.&amp;nbsp; So this is not a new request...and we may turn it on, but for now it is off :ermm:</description><pubDate>Mon, 19 Mar 2007 10:21:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7576.aspx</link><description>Ben, while you're looking at the forum configuration, can you also check for "Edit" permission? There has been times, after posting, I wanted to go back to edit or add, but it won't let me, dueto permission.&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Mon, 19 Mar 2007 09:51:45 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7573.aspx</link><description>I don't think it's a problem with the way you are quoting things... I think it's a problem with the way we might have permissions configured within the forum software.&amp;nbsp; I'll look into it and see.&amp;nbsp; You'll notice that the [codesnippet] also only works when Trent or I use it, but not anyone else...</description><pubDate>Mon, 19 Mar 2007 08:51:59 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7566.aspx</link><description>Off Topic:&lt;br&gt;
&lt;br&gt;
Trent, why is it, when I use the quote "{}" feature of this Forum, my quote does not appear like your above post. The first quote I did, I clicked on {} button, and you can see how it showed. Then when I was quoting Ben's, I clicked on "Quote" button, and you can see again how it appears.&lt;br&gt;
&lt;br&gt;
I only see this problem with this software and nobody else.&lt;br&gt;
&lt;br&gt;
Note: I tried it with IE, FF and Netscape!</description><pubDate>Sat, 17 Mar 2007 09:52:59 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7565.aspx</link><description>[quote]I hope I can make it to training class![/quote]&lt;/P&gt;&lt;P&gt;I hope you can make it....it is definintely worth the time and money!!!!</description><pubDate>Fri, 16 Mar 2007 20:51:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7562.aspx</link><description>[quote][b]Ben Chase (03/16/2007)[/b][hr]Any events that are shared by the form and by the business object (like BeforeSave) are called on the business object first. However, when you have a BO class defined in your application, the event is only raised on the instance, not within the class.&lt;br&gt;
&lt;br&gt;
However, I think you might be talking about your event handlers for that event... if you handle the event in both your CustomersBO class and on the form where you dropped CustomersBO1, then most likely, the handler within the class will be invoked first. However, with event handlers, you can never be assured what order they will be invoked in (because a multicast delegate does not keep track of the order of the handlers), so, when you want to handle an event within the class that declares it, you will almost always want to override the On"EventName" method instead of actually "handling" the event. This way, you can control whether your code within the class will be executed before or after all of the handlers on the event. The actual call to the base method will raise the event, so you can place it at either the top, the bottom, or somewhere in the middle of your overriding method, and the event will be raised then. Like this:&lt;br&gt;
&lt;br&gt;
Protected Overrides Sub OnBeforeSave(ByVal e As BeforeSaveUndoEventArgs)&lt;br&gt;
 '-- Call the base method to raise the event before the code in this method is executed&lt;br&gt;
 MyBase.OnBeforeSave(e) '-- The event will be raised here&lt;br&gt;
&lt;br&gt;
 '-- Do any extra code&lt;br&gt;
&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
The OnEvent() definition is standard .NET coding practices, so just about any time you want to handle an event in a derived class you'll want to override that instead.[/quote]&lt;br&gt;
&lt;br&gt;
Ben, thank you for getting my point. What you described is what I was actually trying to discover/uncover for myself.&lt;br&gt;
Great explanation. Thank you!&lt;br&gt;
&lt;br&gt;
This product is deep... Got a lot to learn. I hope I can make it to training class!</description><pubDate>Fri, 16 Mar 2007 18:50:03 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7544.aspx</link><description>By the same token, since the OnEvent() methods are protected, you can call them (if you need to) to tell the base class to raise that event.</description><pubDate>Fri, 16 Mar 2007 08:56:08 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7542.aspx</link><description>Any events that are shared by the form and by the business object (like BeforeSave) are called on the business object first.&amp;nbsp; However, when you have a BO class defined in your application, the event is only raised on the instance, not within the class.&lt;/P&gt;&lt;P&gt;However, I think you might be talking about your event handlers for that event... if you handle the event in both your CustomersBO class and on the form where you dropped CustomersBO1, then most likely, the handler within the class will be invoked first.&amp;nbsp; However, with event handlers, you can never be assured what order they will be invoked in (because a multicast delegate does not keep track of the order of the handlers), so, when you want to handle an event within the class that declares it, you will almost always want to override the On"EventName" method instead of actually "handling" the event.&amp;nbsp; This way, you can control whether your code within the class will be executed before or after all of the handlers on the event.&amp;nbsp; The actual call to the base method will raise the event, so you can place it at either the top, the bottom, or somewhere in the middle of your overriding method, and the event will be raised then.&amp;nbsp; Like this:&lt;/P&gt;&lt;P&gt;Protected Overrides Sub OnBeforeSave(ByVal e As BeforeSaveUndoEventArgs)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Call the base method to raise the event before the code in this method is executed&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.OnBeforeSave(e) '-- The event will be raised here&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Do any extra code&lt;BR&gt;&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;The OnEvent() definition is standard .NET coding practices, so just about any time you want to handle an event in a derived class you'll want to override that instead.</description><pubDate>Fri, 16 Mar 2007 08:55:20 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7525.aspx</link><description>Trent, thanks for the reply; However, I think I have misled you with my question. Let me try it differently.&lt;br&gt;
The two BOs that I'm referring to, are NOT on the form.&lt;br&gt;
&lt;br&gt;
First I created my CustomerBO [u]in the project[/u] which is basically considered as the CustomerBO Class.&lt;br&gt;
Then I placed a copy of that CustomerBO from the toolbox on my form CustomerBO1.&lt;br&gt;
&lt;br&gt;
My question is, when event on CustomerBO1 is fired (i.e. BeforeSave), does the same event on the CustomerBO Class is fired FIRST?</description><pubDate>Thu, 15 Mar 2007 14:47:42 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7519.aspx</link><description>I guess I did not ask which events you were referring to.&amp;nbsp; The events are fired in the order of the BusinessObjects collection on the form.&amp;nbsp; If you refer to the BusinessObjects collection on the form, this is the order in which the BOs are going to fire the events.&lt;/P&gt;&lt;P&gt;The InitializationPriority has to do with instantiation order basically.&amp;nbsp; It controls the order that the ParentFormLoading event is fired.</description><pubDate>Thu, 15 Mar 2007 14:25:12 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7518.aspx</link><description>I got the following from the help and makes sense for setting and over writting properties:&lt;br&gt;
[quote]A business object is a component, and therefore, utilizes .NET's Component Designer. Because of this, there are two differet places for you to configure a property on a business object: the Component Designer and an a business object instance's property sheet in a form designer. A change to a business object in the Component Designer affects all instances of that business object and is known as a "class-level" change, while a change to the property sheet of an instance of a business object only affects that instance of the business object and is known as an "instance-level" change.&lt;br&gt;
&lt;br&gt;
Many changes to business objects should be made within the Component Designer for that business object as you do not want to have to make the change every time you drop a new instance of the business object on the form. You can, however, override any property on a business object either through the business object instance's property sheet or programmatically at runtime.&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
Can the events be over written, or the BO Components gets fired first and then the Instance?</description><pubDate>Thu, 15 Mar 2007 13:48:26 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7516.aspx</link><description>Ok, I went ahead and put MessageBox on the main BO in the "BeforeSave" event and also a MessageBox the form's BO "BeforeSave" and I left the InitializationPriority=50.&lt;br&gt;
&lt;br&gt;
I run the app and I see the MessageBox in the original BO shows first and then the one the form.&lt;br&gt;
&lt;br&gt;
I then changed those value to 1 and 100 and vice versa, and still see the original BO gets executed first.&lt;br&gt;
&lt;br&gt;
My question was mainly related to the order that which BO events get fired first (The main BO or subsequent ones) and not how it gets initialized on the form.&lt;br&gt;
Thanks!</description><pubDate>Thu, 15 Mar 2007 13:33:26 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Question: Original BO and subsequent copies</title><link>http://forum.strataframe.net/FindPost7512.aspx</link><description>The order in which a BO is dropped on a form has nothing to do with it actually...unless you ignore the INitializationPriority property.&amp;nbsp; You can get more specs on this in the help, but you can set the InitializationPriority property on a BO and actually control which order in which they initialize.</description><pubDate>Thu, 15 Mar 2007 13:06:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>