dcsimg
Association OR Aggregation
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   s_manch
Posted On:   Tuesday, April 6, 2004 02:50 PM

Hello - I have two classes and I am not sure what the relationship among them should be! Business Rule: Every person who is insured gets a letter(Letter-A), and 12 months after getting letter-A he gets Letter-B. Now Letter-A and Letter B are two classes in my class diagram, I am confused about the relationship between them. I think the relationship between Letter A to Letter B is association(since A can exist without B), the relationship between Letter B to Letter A is composition Aggregation. In the above case Letter B and Letter A don't fit the whole-part relationship which is the defintion for aggregation. I would appreciate any comments. thx, sanjay.   More>>

Hello -

I have two classes and I am not sure what the relationship among them should be!



Business Rule: Every person who is insured gets a
letter(Letter-A), and 12 months after getting letter-A he gets Letter-B.



Now Letter-A and Letter B are two classes in my class diagram, I am confused about the relationship between them. I think the relationship between Letter A to Letter B is association(since A can exist without B), the relationship between Letter B to Letter A is composition Aggregation. In the above case Letter B and Letter A don't fit the whole-part relationship which is the defintion for aggregation.



I would appreciate any comments.

thx,
sanjay.

   <<Less

Re: Association OR Aggregation

Posted By:   Simon_Ablett  
Posted On:   Wednesday, April 7, 2004 02:57 AM

I would suggest that there shouldn't be any association between the letter classes. In fact I would go further to suggest that perhaps you dont need to have seperate classes for each letter; unless of course the behaviour of each were sufficiently different to warrant a whole new class. What you may be best doing is having a collection of Letter objects in your controlling class (presumably the user's account class or such like) and then having the differences between individual Letters handled by their attributes. Without going over your requirements spec. in more detail it is hard to give a definitive answer but hopefully the above is of use.

Regards.
About | Sitemap | Contact