In order to provide role based security to my application I’m considering creating my own business objects that implement IIdentity and IPrincipal. I could create these outside of the framework but I would like to access my security DB through the Strataframe data access layer, especially since there was some mention in a previous post of future plans to implement an application server to handle that layer. What's the best approach to take when you want to create a BO that can use the DAL but won't be bound to a form? I don't need the IContainerInterface but I do need to pass parameters to the constructor. Any guidance would be appreciated.
-Larry
All you need to do is create your business object in the usual way, implement the interfaces you require and add your own custom constructor that accepts whatever parameter(s) you want to pass.
Then, where ever you require the BO, just simply construct the object instance as follows:-
PrincipalBO _bizSecurity = new PrincipalBO(object whateverParameter);
I hope I haven't seriously missed the point here
Best
-=Gary
Gary's explanation sounds good. Business objects can be instatiated and used in code just as easily as when dropped on a form. This allows you to do basically anything you need to do with the BO itself. Including inherited the BO to create another class, implementing interfaces, or adding a new constructor to the BO.
There is one thing you may want to keep in mind. If you plan on using this BO on forms, you will want to make sure that your BO will still instantiate properly using the default constructors. These are the constructors that are useed when a BO is dropped on a form. Otherwise, add the interfaces and go to town