I have a few questions regarding my design after having reviewed a number of information sources.
I decided to link the User
and UserSettings
classes with a composition relation (since user settings don't make sense without a specific user). I have defined a method in the UserSettings
class that allows changing the password
, but I would like to know if I can access a private field in the User
class? Or should I make it public? Maybe protected?
I also read that aggregation and composition are redundant relations, and they are mainly used with an indication of multiplicity. But I can use multiplicity in association. So what kind of relationship would it be correct to specify for the relationship of the AddressPoints
and UserSettings
classes? Since I can't decide which would be more appropriate here, aggregation or association.
I would also like to know if it is necessary to specify constructors, setters and getters in classes? Or can it be omitted?
your_addresses
belongs at the pointy end of the association.