|
|
|
|
|
|
|
|
|
| Home | Company | Services | Experience | Process | Articles | FAQs | Contact Us |
Software Design Principles
A module should be open for
extension but closed for modification. It is essentially saying that, a module
or an object shall be encapsulated, interface and implementation shall be
separated, or programming against interface not implementation.
Subclasses should be
substitutable for their base classes. It is essentially saying that subclass
must have all the exact behaviors of the base class.
Depend upon abstractions not upon concretions. It is essentially saying that we shall program against interfaces not implementations, and use interface to define a variable.
Many client specific
interfaces are better than one general purpose interface. It is essentially
saying that don’t put interfaces belong to different clients into one interface
class. On the contrary, define one interface class for each client. If the
system uses the façade pattern, the façade class shall provide handles to those
client specific interfaces, rather than provide the functions directly.
The granule of reuse is the
granule of release.
Classes that change together
belong together.
Classes that are not reused
together should not be grouped together.
The dependencies between
packages must not form cycles.