Modular Architecture

Patterns of Modular Architecture

Category: Dependency Pattern

Colocate Exceptions

Statement
Exceptions should be close to the class or interface that throw them.
Description
Sadly, dealing with exceptions in enterprise software systems is often an afterthought. But allocation of exceptions to modules has significant implications on the modularity, and more specifically the dependencies between modules, within our software system. Placing the exception close to a class that catches [...]

Container Independence

Statement
Modules should be independent of the runtime container.
Description
Modules with excessive runtime container dependencies are heavyweight modules that cannot execute outside the confines of the runtime container. A good example of a heavyweight technology is Enterprise JavaBeans (EJB), and the meteoric rise in popularity of lighter weight frameworks, such as Spring, are the direct result of [...]

Levelize Modules

Statement
Module relationships should be levelized.
Description
Levelized modules demands that module relationships be acyclic. Any cycles in module relationships therefore prevents levelization. There is a close relationship between levelized modules and physical layers, though the two are not the same. Physical layers aims to create one or more modules that are functionally equivalent to the typical layers [...]

Independent Deployment

Statement
Modules should be as independently deployable as possible.
Description
For a module to be independently deployable, it cannot have any outgoing dependencies on any other module. Some module are naturally more independent than others. For instance, it would be relatively easy to create an indepdent module to perform various mathematical and statistical functions, mainly because there are [...]

Physical Layers

Statement
Module relationships must not violate logical layer relationships.
Description
It’s common knowledge that when designing systems of any degree of complexity, the presentation, business logic, and data access should be separated into distinct layers. There are two important considerations when separating the layers.
Each layer should be responsible for a functional aspect of the application. The most common [...]

Acyclic Relationships

Statement
Module relationships should be uni-directional.
Description
When you define a relationship between two system components, their coupling is increased. Some degree of  coupling is a necessary simply because components need to work together with each other to accomplish some task. But certain types of coupling should be avoided. The diagram at right in Figure 1 illustrates a [...]