The Need for Encapsulation

Both biological and computing systems limit unwanted or dangerous dynamic interactions by creating walls or barriers to encapsulate parts of the system.

If it weren’t for the risk – actually virtual certainty – of runaway chemical and biochemical interactions, a pond, lake, or even an ocean could be one large biochemical “organism” and all computing on the planet could share one vast unprotected address space. But mathematical combinatorics dictate that the probability of unforeseen dynamic behavior grows very rapidly as the number of possible interactions grows. To escape that fate, both life and computing have evolved ways to compartmentalize their activity in small, more controllable units that limit most interactions to those possible between elements within the same compartment, allowing only a small subset of active elements to cross the boundaries.

From the beginning, the cell wall separated the chemistry within the cell from that in the surrounding water. Then as cells became more complex, they evolved many sorts of internal membrane-encapsulated organelles. Below is a complete 3D reconstruction of a fission yeast cell by electron tomography (from Höög et al, 2007). The cell contains many different encapsulated compartments of various types indicated by different colors.

yeast electron tomograph

In the realm of multicellular life, other protective encapsulating walls evolved.  Individual tissues such as muscles, livers, the heart and brain, and the digestive track are encapsulated in various membranes.  And, of course, whole organisms are encapsulated within special structures such as skin, bark, shells, and exoskeletons. These encapsulate individuals from their surroundings.

Computing encountered similar issues and evolved similar solutions. In the earliest computers all memory was in one contiguous address space.  Then code and data spaces became separate. Subsequently, the notion of memory spaces became completely abstract with the advent of virtual memory. In the software realm, encapsulation began with separating functions, eliminating GOTO statements, and finally enforced encapsulation in message-sending object-oriented systems. In multicellular computing, encapsulation barriers include "antivirus" software, firewalls, DMZs, and Virtual Private Networks (VPNs).

The various walls that accomplish encapsulation must selectively allow some communication between the interior and the exterior of an encapsulated system -- the passage of bits in the case of computing, and biomolecules in the case of life. And, therein, lies the rub. The selectivity is never perfect. It cannot be! Neither the cell nor the computer can know all the possible consequences of allowing a particular molecule or a particular string of bytes through its enclosing barrier. This inability to deduce in advance the full implications of a piece of information is closely related to the famous "halting problem" in computer science. Since encapsulation is never perfect, it merely reduces the unwanted interactions; it does not eliminate them.

Both life and computing must evolve more general architectural principles to reduce the chaos -- the four principles discussed on this site help to harness the ever growing complexity into ever larger and more effective organized systems.



Last revised 5/27/2014