CSC/ECE 517 Summer 2008/wiki3 8 jb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 6: Line 6:


===Small Interfaces===
===Small Interfaces===
The principle of small interfaces is about keeping the size of method parameters to a minimum [http://cs.anu.edu.au/student/comp2110.2001/lectures/lec23/lec23.html].
The principle of small interfaces says, if any two modules communicate at all, they should exchange as little information as possible [http://www.cs.wustl.edu/~levine/courses/cs342/c++/design-principles_4.pdf]. Following this principle tends to lead to interfaces where native data types are preferred over classes as arguments. This serves to reduce coupling between modules, and reduce the runtime overhead required to pass parameters from caller to callee.


===Explicit Interfaces===
===Explicit Interfaces===

Revision as of 02:01, 22 July 2008

This wiki will explore some of Bertrand Meyer's contribution to OO design, including the principles of small interfaces, explicit interfaces, uniform-access, self-documentation, and single-choice. We intend to show good examples of each principle, discuss their support in languages other than Eiffel, and discuss whether it is difficult to follow these principles in certain OO languages.

Background

Principles

Small Interfaces

The principle of small interfaces says, if any two modules communicate at all, they should exchange as little information as possible [1]. Following this principle tends to lead to interfaces where native data types are preferred over classes as arguments. This serves to reduce coupling between modules, and reduce the runtime overhead required to pass parameters from caller to callee.

Explicit Interfaces

Uniform-access

Self-documentation

Single-choice

Links

Wikipedia page for Bertrand Meyer