[CST-2] UML class diagram

Andrei Legostaev al263@cam.ac.uk
Tue, 5 Jun 2001 00:30:59 +0100


> However, I am really interested in how do 'Unusual dependency relations
> between classes'  can help one to spot that there is no proper
encapsulation
> in the o-o design?

Dependencies between classes should be an exceptional matter (usually
justified by performance concerns).  If all values are properly encapsulated
then there should be no dependencies.

An example where this is not the case: class Employee contains a field
"salary",
class Department also contains an array of salaries (for all employees of
the
department).  There is a dependency (update one, must to update the other),
which in this case indicates a bad design decision.

Sorry if this is a poor explanation.  You should not be revising at this
time
of night anyway!

Good night.

A