The only constant thing about software during its development is change. Changes occur because: it is being created, we find
latent errors in already developed parts, there are performance issues, or customers drive changes in the specifications or
their interpretation. It is critically important that each change has a low probability of causing other conseqential changes.
We build in robustness against change by partitioning a system into relatively small cohesive components that provide stable
interfaces and object factories for the rest of the system to use. Part of the art of building robustness into systems is to
partition into a structure that is suited to its application and each part is loosely coupled to the others.
It is common to think of a system as composed of a view, the application intelligence, and a data store. This is the basis for the
Loosely-Coupled Systems depend on the implementation of two simple ideas:
-
Require all communication between presentation, application, and data layers to use interfaces,
creating the objects that implement the interfaces with object factories.
-
Represent each layer with a model - View Model (VM), Application Model (AM), and Data Model (DM). The application
model is the core of the system, using objects that are familiar to users, making this most complex part, easier to
maintain. The view model handles the transformations between the states of business objects and data in the view.
The data model abstracts away, for the business model, all of the storage details, e.g., connections strings, stored
procedures, etc.
The trick, of course, is not to let the infrastructure of these models and dependency injection run away with the implementation.
That's easier to say than to do. The (in)famous J2EE does all of these things and has the reputation of being big, bloated, and
viciously hard to learn to use well.
The .Net community is trying to do these same things in a more piece-meal fashion
(a good thing, I think) with the Entity Framework for Object Relational Modeling (ORM) and the Unity Framework to handle
Dependency Injections.
I like to think that we can simplify this significantly. We will try some experiments in Projects #4 and #5 to see if we can
indeed do that!