2. About Me
2
Senior Java developer and agile practitioner.
Practicing TDD, clean code. Software craftsmanship
advocate.
Tech lead / Scrum master @ eBay
Team lead @ StartApp, doing, among other things:
● Manages the continuous integration and deployment of the system.
● Leading the coding practices.
Engineering team lead @ AppLift (Berlin)
5. • Robert C. Martin – Uncle Bob
• http://en.wikipedia.org/wiki/SOLID_(object-
oriented_design)
5
Single responsibility principle
Open / closed principle
Liskov substitution principle
Interface segregation principle
Dependency inversion principle
7. SOLID
• Open/closed principle
• Open for extension, but closed for
modification
• Alistair Cockburn: “…Identify points of predicted
variation and create a stable interface around them…”
7
8. SOLID
• Liskov substitution principle
• Replace objects with instances of their
subtypes without altering the correctness of
that program
8
Rectangle
Square
9. SOLID
• Interface segregation principle
• Many client-specific interfaces are better
than one general-purpose interface
9
10. SOLID
• Dependency inversion principle
• Abstractions should not depend on details
• Don’t depend on anything concrete
• Work with interfaces
10
12. Single Responsibility Principle
• Wikipedia
• …the single responsibility principle states that every class
should have a single responsibility, and that responsibility
should be entirely encapsulated by the class. All its services
should be narrowly aligned with that responsibility…
• Clean Code
• A class or module should have one, and only
one, reason to change
12
41. Conclusion
• OOD
• Clean code
• Better practice
41
Do 1 thing
A class should have one
reason to change!
SRP
42. Resources
• http://butunclebob.com/ArticleS.UncleBob.Principles
OfOod
• Uncle Bob about SRP
• http://www.codinghorror.com/blog/2007/03/curlys-
law-do-one-thing.html
• Coding Horror
• https://docs.google.com/file/d/0ByOwmqah_nuGNH
EtcU5OekdDMkk/
• PDF about SRP
• http://eyalgo.com/2014/02/01/the-single-
responsibility-principle/
• My blog post about SRP
42