Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

SOLID principles

179 visualizaciones

Publicado el

SOLID principles presentation and few additional words about DRY, KISS, YAGNI

Publicado en: Software
  • Sé el primero en comentar

SOLID principles

  1. 1. Joanna Lamch SOLID
  2. 2. Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
  3. 3. Problems • Does our code solves challenges and business problems that it should • Is our code human readable • Is our code maintainable • Is our code extensible, scalable • Is our code granular and reusable
  4. 4. Single responsibility principle Class should have only one reason to change Because you can doesn’t mean you should
  5. 5. Open-close principle System elements should be open for extension but closed for modification Lights can be dismantled without taking out an engine
  6. 6. Liskov substitution principle Object of a derived class should be able to replace an object of the base class without bringing any errors in the system or modifying the behavior of the base class If it looks like a duck, and quack like a duck, but it needs batteries, You probably have wrong level of abstraction
  7. 7. Interface segregation principle Many specialized interfaces are better than one almighty. A client should never be forced to implement an interface that it doesn’t need or clients shouldn’t be forced to depend on methods It’s not a good idea to mix electricity and water in one place
  8. 8. Dependency inversion principle The high level module must not depend on the low level module. Both modules should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. You don’t need to know how the engine is build to start it
  9. 9. KISS DRY YAGNI YAGNI You Ain’t Gonna Need It
  10. 10. KISS DRY YAGNI YAGNI DRY Don’t Repeat Yourself WET We Enjoy Typing Write Everything Twice
  11. 11. KISS DRY YAGNI YAGNI DRY KISS Keep It Simple Stupid Keep It Simple, Stupid Keep it Simple Silly Keep It Short & Simple Keep It Small & Simple Keep It Simple &Straightforward