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

Improve Your Software with SOLID Code

flijten
October 19, 2012

Improve Your Software with SOLID Code

You might have heard of the acronym SOLID and the five principles it consists of. Sadly the concepts are very abstract and can be difficult to really understand, while they are so important to writing good object oriented code. This talk will not only deal with the theory behind SOLID and explain why SOLID is important. Better yet, we will be looking at code (lots of it!) and how it can be improved by applying one of the SOLID principles.

flijten

October 19, 2012
Tweet

More Decks by flijten

Other Decks in Programming

Transcript

  1. sOlid Open Closed Principle Software entities (classes, modules, functions, etc)

    should be open for extension, but closed for modification.
  2. soLid Liskov Substition Principle Functions that use pointers or references

    to base classes must be able to use objects of derived classes without knowing it
  3. soLid Liskov Substition Principle 1. Indispensable when adhering to the

    OCP 2. Only when a subclass can be used as its parent in every respect, functions using that parents can be reused without impunity.
  4. solId Interface Segregation Principle Clients should not be forced to

    depend upon interfaces that they do not use.
  5. soliD Dependency Inversion Principle 1. High-level modules should not depend

    on low level modules. Both should depend on abstractions. 2. Abstractions should not depend upon details. Details should depend upon abstractions.
  6. AmsterdamPHP 18-10-2012 Single responsibility principle Open closed principle Liskov subtitution

    principle Interface segregation principle Dependency inversion principle