CSC/ECE 517 Summer 2008/wiki3 8 jb: Difference between revisions
Line 4: | Line 4: | ||
[http://en.wikipedia.org/wiki/Bertrand_Meyer Bertrand Meyer] is a professor of Computer Science at [http://en.wikipedia.org/wiki/ETH_Zurich ETH Zurich], and is the creator of the [http://en.wikipedia.org/wiki/Eiffel_(programming_language) Eiffel] programming language. Meyer authored a book, titled [http://en.wikipedia.org/wiki/Object-Oriented_Software_Construction Object-Oriented Software Construction] in which he presented five principles of good [http://en.wikipedia.org/wiki/Object-oriented_design Object-oriented design]. | [http://en.wikipedia.org/wiki/Bertrand_Meyer Bertrand Meyer] is a professor of Computer Science at [http://en.wikipedia.org/wiki/ETH_Zurich ETH Zurich], and is the creator of the [http://en.wikipedia.org/wiki/Eiffel_(programming_language) Eiffel] programming language. Meyer authored a book, titled [http://en.wikipedia.org/wiki/Object-Oriented_Software_Construction Object-Oriented Software Construction] in which he presented five principles of good [http://en.wikipedia.org/wiki/Object-oriented_design Object-oriented design]. | ||
== | ==Meyer's Five Principles== | ||
===Small Interfaces=== | ===Small Interfaces=== | ||
Line 22: | Line 22: | ||
===Uniform-access=== | ===Uniform-access=== | ||
<i>"All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation"</i> [http://en.wikipedia.org/wiki/Uniform_access_principle Meyer]<br> | <i>"All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation"</i> [http://en.wikipedia.org/wiki/Uniform_access_principle Meyer]<br> | ||
[[image:uniform_access.gif]] | |||
===Self-documentation=== | ===Self-documentation=== |
Revision as of 02:06, 23 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
Bertrand Meyer is a professor of Computer Science at ETH Zurich, and is the creator of the Eiffel programming language. Meyer authored a book, titled Object-Oriented Software Construction in which he presented five principles of good Object-oriented design.
Meyer's Five Principles
Small Interfaces
"If any two modules communicate at all, they should exchange as little information as possible" Meyer
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. The idea of a central data source is key to implementation of small interfaces.
Explicit Interfaces
"If two modules communicate, this must be obvious from the text of either or both" Meyer
Uniform-access
"All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation" Meyer
Self-documentation
"The designer of a module should strive to make all information about the module part of the module itself" Meyer
Single-choice
"Whenever a software system must support a set of alternatives, one and only one module in the system should know their exhaustive list"
Meyer
Links
Wikipedia page for Bertrand Meyer
Lesson on OO drawing on Bertrand's principles
[1]