Minimal public interface

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(New page: Riel's Heuristic #2.4: [[Minimal public interface|Implement a minimal public interface that all classes understand [e.g., operations such as copy (deep versus shallow), equality testing, p...)
 
(See Also)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Riel's Heuristic #2.4: [[Minimal public interface|Implement a minimal public interface that all classes understand [e.g., operations such as copy (deep versus shallow), equality testing, pretty printing, parsing from an ASCII description, etc.].]]
+
:''Implement a minimal public interface which all classes understand (e.g. operations such as copy (deep versus shallow), equality testing, pretty printing, parsing from a ASCII description, etc.).'' --Riel's Heuristic 2.4, [[Arthur Riel 1996]]
  
 
==Description==
 
==Description==
From chapter 2.2 in {{Ref|1}}:
+
Chapter 2.4 in [[Arthur Riel 1996]] states that:
 
<blockquote>
 
<blockquote>
 
''If the classes that a developer designs and implements are to be reused by other developers in other applications, it is often useful to provide a common minimal public interface. This minimal public interface consists of functionality that can be reasonably expected from each and every class. The interface serves as a foundation for learning about the behaviors of classes in a reusable software base.''
 
''If the classes that a developer designs and implements are to be reused by other developers in other applications, it is often useful to provide a common minimal public interface. This minimal public interface consists of functionality that can be reasonably expected from each and every class. The interface serves as a foundation for learning about the behaviors of classes in a reusable software base.''
Line 12: Line 12:
 
</blockquote>
 
</blockquote>
  
Riel then goes on to describe the following minimal public interface:
+
Riel then goes on to describe a public interface that implements the following:
 
*Constructor
 
*Constructor
 
*Destructor
 
*Destructor
Line 23: Line 23:
 
*Parse
 
*Parse
 
*Self-test
 
*Self-test
==References==
+
 
#{{Note|1}} Riel, A. J. 1996 ''Object-Oriented Design Heuristics.'' 1st. Addison-Wesley Longman Publishing Co., Inc.
+
==See Also==
 +
*[[Design by contract]]
 +
*[[Minimize number of methods]]
 +
*[[Riel's heuristics]]
 +
*[[Design maxims]]
 +
*[[Avoid interface bloat]]
 +
*[[Avoid interface pollution]]
 +
 
 +
[[Category:Riel's heuristics]]

Latest revision as of 02:33, 22 July 2009

Implement a minimal public interface which all classes understand (e.g. operations such as copy (deep versus shallow), equality testing, pretty printing, parsing from a ASCII description, etc.). --Riel's Heuristic 2.4, Arthur Riel 1996

Description

Chapter 2.4 in Arthur Riel 1996 states that:

If the classes that a developer designs and implements are to be reused by other developers in other applications, it is often useful to provide a common minimal public interface. This minimal public interface consists of functionality that can be reasonably expected from each and every class. The interface serves as a foundation for learning about the behaviors of classes in a reusable software base.

Chapter 9.5 continues with:

The minimal public interface gives users of a collection of reusable classes a basis for understanding the collection's architecture. Users come to expect a minimal functionality from anything they use in the collection.

Riel then goes on to describe a public interface that implements the following:

  • Constructor
  • Destructor
  • Copying objects
    • Deep
    • Shallow
  • Assigning objects
  • Equality testing
  • Print
  • Parse
  • Self-test

See Also

Personal tools