single responsibility principle

10
Design patterns: The Single-Responsibility Principle Grzegorz Wilczyński 11th november 2012

Upload: grzegorz-wilczynski

Post on 06-May-2015

22.001 views

Category:

Technology


1 download

DESCRIPTION

Single responsibility principle

TRANSCRIPT

Design patterns: The Single-Responsibility

Principle

Grzegorz Wilczyński 11th november 2012

SOLID

The principles when applied together intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.

http://en.wikipedia.org/wiki/Solid_(object-oriented_design)

SOLID

Single responsibilityOpen-closedLiskov substitutionInterface segregationDependency inversion

http://en.wikipedia.org/wiki/Solid_(object-oriented_design)

BIBLE

http://www.amazon.com/Agile-Principles-Patterns-Practices-C/dp/0131857258

Rule #1

A class should have only one reason to change.

"Agile Principles, Patterns, and Practices in C#" Robert C. Martin

Rule #2

A class should have only one reason to change.

"Agile Principles, Patterns, and Practices in C#" Robert C. Martin

So please don't...

http://3.bp.blogspot.com/-FQZ4VT_gbRY/T8RvXLTPWMI/AAAAAAAABP0/JCckSpENM88/s640/SingleResponsibilityPrinciple.jpg

Step 1

http://www.remondo.net/wp-content/uploads/2012/03/SingleResponsibilityPrincipleRadio.png

Step 2

http://www.remondo.net/wp-content/uploads/2012/03/SingleResponsibilityPrincipleRadioManagers.png

Homework

$ git branch gw-solid-1

end time: 16.11.2012