One approach is to create an Event class. This class's responsibility is to run any methods that work with more than one business object. It istantiates the buiness objects if they are already not istantiated, then run the method(s). It then would release the business objects if it created then originally.
>hi,
> I am beginner of OOP. I have 3 classes, datasource, validator and busines class. Business object instance will have a property that reference to datasource object and also another property to reference validator object.
>
>I am confusing on where should I place the method. I need to create a class that add/update/delete staff record. Therefore, I will create an instance of business class. Business Class will create an instance of datasource and validator object by default. Now, if my program want to calculate staffs' commission, I may need to access staff, sales, sales details at the same time.
>
>Where should I place this function, business class?
>Since, I need to access at least 3 tables, should I create 3 instance of datasource, or 3 instance of business class??
>
>How is your design?
>
>Thank you
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi