B.Single Responsibility Principle(SRP)

  1. Summary
    1. It says there should be only one reason to change
    2. It recommends Encapsulate what varies.
    3. Prefer High Cohesion (single responsibility) and low coupling
    4. Always do a Commonality Vs Variability analysis while identifying Classes in your system.
    5. All the methods of should modify it`s own state only not someone else.
    6. The Single Responsibility Principle represents a good way of identifying classes during the design phase of an application and it reminds you to think of all the ways a class can evolve.
    7. A good separation of responsibilities is done only when the full picture of how the application should work is well understand.
  2. Applicability
    1. When defining new class apply this principle as early as possible
    2. Do a responsibility analysis to figure out if this principle is broken. 
  3. Example

  4. Related Principle 
    1. Open Close Principle
  5. References 
    1. http://www.oodesign.com/single-responsibility-principle.html