CSC/ECE 517 Fall 2009/wiki3 13 b5: Difference between revisions
Chump Chief (talk | contribs) |
Chump Chief (talk | contribs) |
||
Line 12: | Line 12: | ||
== Application == | == Application == | ||
One area in which it may be difficult to implement interfaces while adhering to the principle of explicit interfaces is shared data. Bertrand Meyer recognizes this problem and diagrams it as: | |||
[[Image:Principle_of_Explicit_Interfaces_Data_Sharing.png]] | |||
This illustrates how two modules may interact in an indirect manner. Although the two modules do not directly interact on each other, by relying on a common resource changes to module A may impact how module B functions. | |||
== External Links == | == External Links == |
Revision as of 09:15, 18 November 2009
Principle of Explicit Interfaces
Definition
The Principle of Explicit Interfaces is proposed by Bertrand Meyer in his book Object-Oriented Software Construction. It states
Whenever two modules A and B communicate, this must be obvious from the text of A or B or both.
Motivation
The Principle of Explicit Interfaces refers to the attempt to ensure that relationships between separate modules are easily found and understood. This is important when considering making a change to the code base. It allows the programmer to quickly see what other modules his work might impact, preventing unintended side effects.
Application
One area in which it may be difficult to implement interfaces while adhering to the principle of explicit interfaces is shared data. Bertrand Meyer recognizes this problem and diagrams it as:
This illustrates how two modules may interact in an indirect manner. Although the two modules do not directly interact on each other, by relying on a common resource changes to module A may impact how module B functions.
External Links
Sources
- Meyer, Bertrand. Object-Oriented Software Construction, 2nd edition p50. ISE Inc., Santa Barbara, CA, 1997.