The attibutes inherent to the roll should go into CRoll. Maintenance tasks should go into separate classes such that collections of these tasks can be related to (or owned by) a CRoll instance. Maintenance tasks may be able to share an interface if you can find common ground between them, such as the info on Inspection and Grinding.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
What Ezzaral said is true that " The attibutes inherent to the roll should go into CRoll", but IMO in the given list there are no such attrs. All attrs are specific to different usecases.
An inherent attr would be something like a serial number (if there is such a thing for rolls), which is independent of usecase. In most cases the attr that identifies an object uniquely (e.g. name for CStudent, account number for CBankAccount, passport number for CDomesticPassport...) is the best example of such an attr.
Your CRoll class could/should have only the inherent attrs are members. Other attributes (rolling-process related, commercial, maintenance related etc) could be grouped in separate structures. E.g. CRollProcAttrGroup, CCommAttrGroup, CMaintAttrGroup.. (if you're using C/C++ these could be structures instead of classes).
Association/relation between CRoll and these AttrGroup could be done in many ways:
1. Inheritance. Not really correct as there is no "is a" relation between an AttrGroup and CRoll.
2. Containment/Aggregation: CRoll could have member variable(s) of type XXXAttrGroup. Given that one obj of CRoll in one usecase doesn't really need to have all AttrGroups, a space efficient solution would be to derive all XXXAttrGroup classes/structs from a BaseAttrGroup class/struct, and have a member variable of this type (BaseAttrGroup) in CRoll.
3. Leave it to client to keep teh association. :). Possible if it's okay from requirement point of view.
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75