Pergunta de entrevista da empresa Quickparts

What are the five principles of object oriented design?

Resposta da entrevista

Sigiloso

10 de set. de 2012

SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) -- posited by Robert Martin 200x. Single responsibility -- a class should do only one thing. Open-closed -- Software should be open for extension, but closed for modification. Liskov substitiution -- when working with objects that implement an interface, any object that implements the interface should be substitutable. Interface segregation -- many client interfaces are better than one general purpose interface. Dependency inversion -- publish what you need in an abstract sense, and let other components implement it, then use them; don't rely on the specific components' implementation.