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
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...