Home

Encapsulation theory in 39 seconds.


The Principle of Burden takes two forms.

The strong form states that the burden of transforming a collection of entities correlates with the number of entities transformed. The weak form states that the maximum possible burden of transforming a collection of entities correlates with the maximum possible number of entities transformed.

The most concise summary of encapsulation theory is that encapsulation mitigates the weak form of the Principle of Burden.

In slightly more detail, the International Organisation for Standardization defines encapsulation as the property that the information contained in an object is accessible only through interactions at the interfaces supported by the object.

At a higher level of abstraction, program units, too, may be encapsulated within subsystems, whereby the information contained in the subsystem is accessible only through public program units contained within the subsystem.

The burden of creating or updating any software system correlates with the number of program units created or updated.

Program units that depend on a particular, updated program unit have a higher probability of being impacted than program units that do not depend on the updated program unit.

The maximum possible burden an updated program unit can impose is the impacting of all program units that depend on it.

Reducing the dependencies on an updated program unit therefore reduces the probability that its update will impact other program units and so reduces the maximum possible burden that that program unit can impose.

Reducing the maximum possible number of dependencies between all program units in a system therefore reduces the probability that an impact to a particular program unit will cause updates to other program units, and thus reduces the maximum possible burden of all updates.

Encapsulation theory shows how to use encapsulation to reduce the maximum possible number of dependencies between all program units.

Encapsulation theory therefore shows how to use encapsulation to mitigate the weak form of the Principle of Burden.

It shows this by addressing the two, fundamental sources of dependencies within a system.

Merely by being contained within a subsystem, a target program unit may be depended upon by all the other program units in the same subsystem, thus minimising the number of program units per subsystem reduces the maximum possible number of dependencies.

The number of program units that can possibly depend on a target program unit is also related to the target program unit's accessiblity. If a target program unit is public, then all program units in all other subsystems may depend on it, thus minimising the number of public program units reduces the maximum possible number of dependencies.

These two forces, of course, act on software configurations in opposing ways but an optimal balance of these forces is possible.

Encapsulation theory shows how to approach this balance so that a wide family of systems may achieve optimal encapsulation.

Copyright (C) Edmund Kirwan 2008. All rights reserved.