Scratching SOLIDIULIAN TANASESCU-VLAD10 / 03 / 2012
So … what is SOLID?Five basic principles of object-orientedprogramming and design.Single responsibility principleOpen/clos...
Who put them together?What do you know … its Uncle Bob!Robert C. Martin http://objectmentor.com/omTeam/martin_r.html
SRP
SRPEvery object should have a singleresponsibility and that responsibility shouldbe entirely encapsulated by the class.   ...
SRP“a measure of how strongly-related or focused the responsibilities of a single module are”               COHESION!
OCP
OCPSoftware entities (classes, modules,functions, etc.) should be open for extension,but closed for modification.         ...
OCP
LSP
LSPIf S is a subtype of T, then objects of type Tmay be replaced with objects of type Swithout altering any of the desirab...
ISP
ISPOnce an interface has become too fat itneeds to be split into smaller and morespecific interfaces.                     ...
DIP
DIPA. High-level modules should not depend onlow-level modules. Both should depend onabstractions.B. Abstractions should n...
DIP“a degree to which each program modulerelies on each one of the other modules”               COUPLING!
Please fill in the evaluation             forms        Thank you!
Upcoming SlideShare
Loading in...5
×

CodeCamp Iasi 10 march 2012 - Scratching-SOLID

590

Published on

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
590
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CodeCamp Iasi 10 march 2012 - Scratching-SOLID

  1. 1. Scratching SOLIDIULIAN TANASESCU-VLAD10 / 03 / 2012
  2. 2. So … what is SOLID?Five basic principles of object-orientedprogramming and design.Single responsibility principleOpen/closed principleLiskov substitution principleInterface segregation principleDependency inversion principle
  3. 3. Who put them together?What do you know … its Uncle Bob!Robert C. Martin http://objectmentor.com/omTeam/martin_r.html
  4. 4. SRP
  5. 5. SRPEvery object should have a singleresponsibility and that responsibility shouldbe entirely encapsulated by the class. WikipediaResponsibility!? … not againAh … a reason to change
  6. 6. SRP“a measure of how strongly-related or focused the responsibilities of a single module are” COHESION!
  7. 7. OCP
  8. 8. OCPSoftware entities (classes, modules,functions, etc.) should be open for extension,but closed for modification. WikipediaOpen and closed … another paradox!?New functionality can be added as newrequirements are generated.Never modify the code except to correct bugs.
  9. 9. OCP
  10. 10. LSP
  11. 11. LSPIf S is a subtype of T, then objects of type Tmay be replaced with objects of type Swithout altering any of the desirableproperties of that program (correctness, taskperformed, etc.) WikipediaThat sounds so ... formal!Code that uses a base class must be able tosubstitute it with a subclass without knowingit.
  12. 12. ISP
  13. 13. ISPOnce an interface has become too fat itneeds to be split into smaller and morespecific interfaces. WikipediaWhy!?COHESION!No client should be forced to depend onmethods it does not use.
  14. 14. DIP
  15. 15. DIPA. High-level modules should not depend onlow-level modules. Both should depend onabstractions.B. Abstractions should not depend upondetails. Details should depend uponabstractions. Wikipedia
  16. 16. DIP“a degree to which each program modulerelies on each one of the other modules” COUPLING!
  17. 17. Please fill in the evaluation forms Thank you!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×