Design

Design

Old forum URL: forums.lhotka.net/forums/t/5531.aspx


KJosh posted on Saturday, October 04, 2008

Hi,

I have one application Employees. And In this application, I have collect information about employee, Get Address like I have some more different functionalities. While developing the business objects, I have one object CollectInfo having properties, fields to get the data from user interface. Adress object to collect address data. For each functionality, I developed the separate business objects. Each functionality is different tab in user interface as part of Employee. Now How we combine these different functionality objects as one Employee object.

a) put the each functionality object as property in employee class. This way, If we have 30 functionalities as part of employee then we have 30 properties. Suppose we have different type of employee to which certain functionality is not applicable, then creating the EmployeeABC class and put the functionality a part of that object?

b) Second approach is: Considering each functionality as secondary Form object.  Employee class does not contain any properties. And in the FormFactory class add all those scondary forms to the Employee. This way I have one form class which has one SaveForm method which will be responsible for calling respective Save methods in each functionality object. Ech functionality objects are deriving from secondaryform which is deriving from Form.

Which is the best way?

Copyright (c) Marimer LLC