SOLID                          and Better Design                          and Better Design                               ...
Writing Software is not hardYou spend more time    Reading and Modifying it
Design Smells1. Rigidity2. Fragility3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. OpacityPhoto b...
Design Smells1. Rigidity     The system is hard to change because                every change forces many other2. Fragilit...
Design Smells1. Rigidity     Changes cause the system to break in                places that have no conceptual2. Fragilit...
Design Smells1. Rigidity     It is hard to disentangle the system into                components that ca be reused in othe...
Design Smells1. Rigidity     Doing things right is harder than doind                things wrong.2. Fragility3. Immobility...
Design Smells1. Rigidity     The design contains infrastructure that                adds no direct benefit.2. Fragility3. ...
Design Smells1. Rigidity     The design contains repeating structures                that could be unified under a single2...
Design Smells1. Rigidity     It is hard to read and understand. It does                not express its intent well.2. Frag...
• Cohesion  – All responsibilites of a module should be    related and focused.• Coupling  – How much a module depends upo...
S.O.L.I.D.• Single Responsibility• Open Closed• Liskov Substitution• Interface Segregation• Dependency InversionPhoto by J...
Single Responsibility Principle• One class should have only one reason  to change.• One responsability, one reason to  cha...
Open Closed Principle• Open for extension• Closed for modification• Design modules to never change.• A change should impac...
Liskov Substitution Principle• If you use a class, you should be able  to use its base class.
Interface Segregation Principle• Clients should not be obliged to  depend upon interfaces they not use
Dependency Injection Principle• Higher level modules should not  depend upon low level modules
4 rules of simple design1. Runs all the tests2. Contains no duplication3. Expresses the intent of the  programmer4. Minimi...
Summary
Read More
References• http://www.slideshare.net/JuanjoFuchs/solid-cmo-  lo-aplico-a-mi-cdigo• SOLID Development by Chris Deweese  ht...
Moltes Gràcies(Thank you very much)    Toni Tassani    Toni Tassani    @atassani    http://alapamui.blogspot.com    Barcel...
SOLID and Better Design
SOLID and Better Design
SOLID and Better Design
SOLID and Better Design
SOLID and Better Design
SOLID and Better Design
Upcoming SlideShare
Loading in …5
×

SOLID and Better Design

539 views
453 views

Published on

SOLID Principles for Better Software Design

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
539
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SOLID and Better Design

  1. 1. SOLID and Better Design and Better Design Toni Tassani March 2013Photo by Roy Higson. http://www.fotopedia.com/items/roytheboy-Q13G6ugLM0I
  2. 2. Writing Software is not hardYou spend more time Reading and Modifying it
  3. 3. Design Smells1. Rigidity2. Fragility3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. OpacityPhoto by Elaine Adolfo http://www.fotopedia.com/items/flickr-469125880
  4. 4. Design Smells1. Rigidity The system is hard to change because every change forces many other2. Fragility changes to other parts of the system.3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  5. 5. Design Smells1. Rigidity Changes cause the system to break in places that have no conceptual2. Fragility relationship to the part that was changed.3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  6. 6. Design Smells1. Rigidity It is hard to disentangle the system into components that ca be reused in other2. Fragility systems.3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  7. 7. Design Smells1. Rigidity Doing things right is harder than doind things wrong.2. Fragility3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  8. 8. Design Smells1. Rigidity The design contains infrastructure that adds no direct benefit.2. Fragility3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  9. 9. Design Smells1. Rigidity The design contains repeating structures that could be unified under a single2. Fragility abstraction.3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  10. 10. Design Smells1. Rigidity It is hard to read and understand. It does not express its intent well.2. Fragility3. Immobility4. Viscosity5. Needless Complexity6. Needless repetition7. Opacity
  11. 11. • Cohesion – All responsibilites of a module should be related and focused.• Coupling – How much a module depends upon others
  12. 12. S.O.L.I.D.• Single Responsibility• Open Closed• Liskov Substitution• Interface Segregation• Dependency InversionPhoto by Jean Christophe Prunet http://www.fotopedia.com/items/_avPIZmqM3w-vdSxZGLACsg
  13. 13. Single Responsibility Principle• One class should have only one reason to change.• One responsability, one reason to change
  14. 14. Open Closed Principle• Open for extension• Closed for modification• Design modules to never change.• A change should impact only one module.• Abstraction
  15. 15. Liskov Substitution Principle• If you use a class, you should be able to use its base class.
  16. 16. Interface Segregation Principle• Clients should not be obliged to depend upon interfaces they not use
  17. 17. Dependency Injection Principle• Higher level modules should not depend upon low level modules
  18. 18. 4 rules of simple design1. Runs all the tests2. Contains no duplication3. Expresses the intent of the programmer4. Minimizes the number of classes and methods Kent Beck
  19. 19. Summary
  20. 20. Read More
  21. 21. References• http://www.slideshare.net/JuanjoFuchs/solid-cmo- lo-aplico-a-mi-cdigo• SOLID Development by Chris Deweese http://www.slideshare.net/cdeweese/solid- development• SOLID Design Principles by Bruno Bossola http://www.slideshare.net/bbossola/geecon09- solid• Solid Development Practices in Motivational Pictures http://lostechies.com/derickbailey/2009/02/11/soli d-development-principles-in-motivational- pictures/
  22. 22. Moltes Gràcies(Thank you very much) Toni Tassani Toni Tassani @atassani http://alapamui.blogspot.com Barcelona -

×