SOLID principles

FedraJL 456 views 14 slides Sep 02, 2017
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

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


Slide Content

Joanna Lamch SOLID

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Problem s 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

Single responsibility principle Class should have only one reason to change Because you can doesn’t mean you should

Open-close principle System elements should be open for extension but closed for modification Lights can be dismantled without taking out an engine

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

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 they do not use. It’s not a good idea to mix electricity and water in one place

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

KISS DRY YAGNI YAGNI You Ain’t Gonna Need It

KISS DRY YAGNI YAGNI DRY Don’t Repeat Yourself WET We Enjoy Typing Write Everything Twice

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

KISS DRY YAGNI YAGNI DRY KISS
Tags