StrataFrame Forum

Business Object listens for its own events?

http://forum.strataframe.net/Topic29645.aspx

By Sam Tenney - 3/4/2011

I am studying best practices for C# event coding and handling.  I was surprised to find that when the business object mapper creates a business object it creates two stub methods to handle the business object's CheckRulesOnCurrentRow event and the SetDefaultValues event.  Based on what I have read, I expected the business object mapper to create override methods for OnCheckRulesOnCurrentRow and OnSetDefaultValues to control the events.  Setting up a business object to listen for and handle its own events seems unusual and so I am guessing that there may be some good reason that I am not aware of.  Is there some advantage to the way it has been done or is there a disadvantage to using the other approach?  I am just trying to learn from the experts.

Sam Tenney