Notes on Design
In Diva, we are trying to make software that is reusable and extensible. To do so, we prefer interfaces over
abstract classes, components over frameworks, and sub-systems over applications.
Interfaces reduce dependencies by allowing alternative implementations, and by encouraging an accurate
understanding of the role played by the interface. Because they are independent of implementation concerns, the
understanding of collaboration between implementing components is much clearer.
Components reduce brittleness by encouraging composition instead of sub-classing. Frameworks tend to
be brittle, even if carefully designed, because they have to assume more about the way that they will be used in
the future than a component does. Frameworks require modification to change these assumptions; components require
only adaptors or facades.
Sub-systems encourage re-use by making arbitrarily complex collections of objects accessible without
unnecessary assumptions about end-use. Applications are important, of course, but if an application mostly consists
of re-applicable sub-systems, then we like to extract those sub-systems and define an interface to them.
|