My question is - User and Role - both entities can have attributes linked to them,. So they have an instance of AttributeSet - which has list of attributes and operations to be performed on them defined.
But Attribute - have their own existence as well - they can exist independently of other entities and it can have some more behaviours defined - which may not be applicable when it is linked to any of the Entity.
How do I capture this in a class design?.
If I keep a reference of those attributes which are linked to the enity inside the entity class then - I have a problem of updating the "TOTAL" set when the individual attribute linked to the entity changes...
Or I do not keep attributes linked to the entity inside the entity class.,... but instead keep all of the attributes in AttributeSet class only...
I'm not sure I understand the problem. Perhaps it would help if you showed us more code?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Sep 18, 2004
User and Role are linked to attributes. But attribute can exist without the linkage also. Should the User or Role class "HAve" an instance of AttributeSet in them or not?
Or can we make AttributeSet have all the Attributes (Those linked to User and Role as well?) and make it responsible for any queries related to any attributes linked or not to any User or Role. In this case we get:
[ August 04, 2006: Message edited by: Shivani Chandna ]