CSC/ECE 517 Fall 2007/wiki3 3 qq: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
In Object-Oriented Design (OOD)
In Object-Oriented Design (OOD)
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.  
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.  
* Different responsibilities should be divided among different objects of the class. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).
 
=== The Advantage of Separation of Responsibility ===
* Decreases coupling between two objects. One object do not need to know the linked list and what kind of object the pointer points to.

Revision as of 17:37, 16 November 2007

Topic

Take the principle of Separation of Responsibility and catalog the information on it available on the Web. Find good descriptions and good, concise, understandable examples. Tell which you consider the best to present to a class.

Defination of Separation of Responsibility

In Object-Oriented Design (OOD)

  • One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.
  • Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).

The Advantage of Separation of Responsibility

  • Decreases coupling between two objects. One object do not need to know the linked list and what kind of object the pointer points to.