Wednesday, February 3, 2010

Fundamental Class Design Principles

The obvious complexity metric of a class library from the point of view outside the class is the number of interconnections between classes, in particular, getter and setter connections.

There are some exceptions to this metric.  In a Model View Controller design the controller will need set access to the model values and the view will need get access.  In a language like C++ that has the concept of friend classes this tight relationship can be explicitly specified.  In other languages the connections need to be observed.

Direct access from further away than functionally coupled classes is an indication of either a design issue or a violation of the existing design.

No comments:

Post a Comment