StrataFrame Forum

Support to create inheritance layer for BO's

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

By Richard Keller - 2/20/2007

I'd like to extend the Business Object Inheritance Layer and addfew simple services like FillAll ( Which loads all records ), auditing services , optional serialization service , and extended Defaults Service.  I'd have to go into each Business Object and change the inheritance from

     Public Class SystemProgram

Inherits MicroFour.StrataFrame.Business.BusinessLayer

To

Public Class SystemProgram

Inherits {AppName}.Business.BusinessLayer.Extended 

Is there a way to do this right now?  I realize that I can go into each object and change the it there, but I thought that a setting might exist to allow the optional selection of the business layer to be used.

Richard

 

By Trent L. Taylor - 2/21/2007

You only have to change it once.  If you'l notice, the inerhits command is in the main BO file not the partial that is generated through the BO mapper.  So you only have to change the inherited tag once when the BO is created.  You could also create your own template that has the BO inheriting your BO class so you do not have to change this when you create the BO.  But in either case, the BO mapper will not overwrite the inherited statement since the inherited statement is not in the partial class.
By Richard Keller - 2/21/2007

Thanks for the Template Idea, that worked out perfect.   For Anyone who would like instructions on how to build a template.

http://msdn.microsoft.com/msdnmag/issues/06/01/CodeTemplates/default.aspx.

That is the easiest thing I have ever done.  

Richard

By StrataFrame Team - 2/22/2007

Thanks for posting that link... it gives people a place to go.  And once you get the template created, you can modify the .vstemplate file and the corresponding code files within the .zip file that is created.  Most of the tags within the .vstemplate file are pretty self-explanatory.