i found this very interesting article in Solid Principles
Single Responsibility Principle
"There should never be more than one reason for a class to change." — Robert Martin, SRP paper linked from The Principles of OODMy translation: A class should concentrate on doing one thing
Open Closed Principle
My translation: Change a class’ behaviour using inheritance and composition"Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification." — Robert Martin paraphrasing Bertrand Meyer, OCP paper linked from The Principles of OOD
Liskov Substitution Principle
My translation: Subclasses should behave nicely when used in place of their base class"Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it." — Robert Martin, LSP paper linked from The Principles of OOD
Interface Segregation Principle
My translation: Keep interfaces small and cohesive"Clients should not be forced to depend upon interfaces that they do not use." — Robert Martin, ISP paper linked from The Principles of OOD
Dependency Inversion Principle
"A. High level modules should not depend upon low level modules. Both should depend upon abstractions.
B. Abstractions should not depend upon details. Details should depend upon abstractions." — Robert Martin, DIP paper linked from The Principles of OODMy translation: Use lots of interfaces and abstractions
Extracetd from - http://davesquared.net/2009/01/introduction-to-solid-principles-of-oo.html
Cheers !!!
No comments:
Post a Comment