A class should have one, and only one, reason to change
You should be able to extend a classes behavior, without modifying it &quot;Software entities should be open for extension, but closed for modification.“ - Robert C. Martin “… the essence of the Open/Closed Principle is being able to add new functionality to an existing codebase by writing completely new code with minimal modification of existing code. ”
Derived classes must be substitutable for their base classes.
Make fine grained interfaces that are client specific.
Depend on abstractions, not on concretions
Agile design Best practices We believe that it is possible. Igor Moochnick Principal IgorShare Consulting [email_address] Blog: www.igorshare.com/blog
Package Cohesion Principles REP The Release Reuse Equivalency Principle The granule of reuse is the granule of release. CCP The Common Closure Principle Classes that change together are packaged together. CRP The Common Reuse Principle Classes that are used together are packaged together.
Package Coupling Principles ADP The Acyclic Dependencies Principle The dependency graph of packages must have no cycles. SDP The Stable Dependencies Principle Depend in the direction of stability. SAP The Stable Abstractions Principle Abstractness increases with stability.
“ I don't care how good you think your design is. If I can't walk in and write a test for an arbitrary method of yours in five minutes, it’s not as good as you think it is, and whether you know it or not, you're paying a price for it.”