s.o.l.i.d principles

Post on 14-Jan-2017

65 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

S.O.L.I.D

Principles

By PaulBBy Paulo Monteiroyo Monteiro

Liskov Substitution Principle :

The Liskov Substitution Principle says that the 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.

Ugly duck can eat ?

This is the Ugly Duck ...

Ugly duck can eat ?

Ugly duck can fly ?

Ugly duck can eat ?

Ugly duck can fly ?

Ugly duck can quack?

Is a

??????

Remembering the Liskov Substitution Principle is easy:

ask if an “object” can be substituted for another “object” before inheriting.

top related