The SOLID PrinciplesReading Geek Night
My digital identityBlog: http://blog.lukesmith.netTwitter: @lukesmith
What the?An acronym of acronymsCollection of best-practicesloose-couplingMaintainabilityPrinciples – not RulesFocus on dependency management
Dependency managementPoor dependency managementHard to changeFragileNon-reusableGood dependency managementFlexibleRobustReusable
Single Responsibility PrincipleA class should have one, and only one, reason to change
Single Responsibility PrincipleBenefitsMore readable codeMore robustMore maintainableSmaller functions
Open Closed PrincipleSoftware entities should be open for extension, but closed for modification
Open Closed PrincipleChange to an entity cascades changes to dependent modules
Fragile
Unpredictable
Modules should never change
Extend behaviour – add new code
Don’t change existing working codeLiskov Substitution PrincipleDerived classes must be substitutable for their base classes
Liskov Substitution PrincipleImportant for any program conforming to OCP
Caller should not be surprised by substituting base type for subtype
Virtual members must exist in derived classes
Must do useful + expected workLiskov Substitution PrincipleUseful work

The Solid Principles

Editor's Notes

  • #3 What is SOLID
  • #4 Collection of object orientated design best practicesSpaghetti code often due to poor dependency management
  • #5 Collection of object orientated design best practicesSpaghetti code often due to poor dependency management
  • #6 0
  • #7 SRP