Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOLID Principles

Avatar for Fran Fran
June 17, 2016

SOLID Principles

Avatar for Fran

Fran

June 17, 2016

Other Decks in Programming

Transcript

  1. A term describing a collection of design principles for good

    code that was coined by Robert C. Martin aka Uncle Bob What?
  2. O OPEN-CLOSED PRINCIPLE You should be able to extend a

    class behavior, without modifying it.
  3. This class violates the Open/Closed principle. It is not closed

    for modification and it is not open to extension. Every time a new shape comes along we have to modify the OPEN-CLOSED PRINCIPLE
  4. L LISKOV SUBSTITUTION PRINCIPLE Objects in a program should be

    replaceable with instances of their subtypes without altering the correctness of that program.
  5. D DEPENDENCY INVERSION PRINCIPLE High-level modules should not depend on

    low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. Depend on Abstractions. Do not depend on concretions.