© Daniel D'Agostino 2006
<< Back to Gigi's Computer Corner
This article presents the concept of everything having a head and a body; this concept includes (but is not limited to) both programs and data. The idea is closely related to both the MVC paradigm as well as the separation of content and presentation on the web.
The article begins with the idea of separation of content and presentation on the web, and then evolves the idea into the field of programming. Finally, the holistic theorem, in which everything must have a head and a body to be whole, is generalised to all kinds of files, i.e. both programs and data.
It is now a widely accepted idea that content in HTML pages should be separated from the presentation information associated with them, normally stored in CSS files. This was after the mess made by HTML 3.2, which introduced the <font> tag, so that people intertwined layout tags and structure tags, making a mess of HTML pages.
Eventually, the <font> tag was deprecated, and the use of CSS was widely encouraged. This allowed web designers to separate content and presentation. HTML could actually be used to give a page structure, while CSS would take care of presentation separately. This means that a change in a single CSS file could make site-wide changes, making it much easier to manage the layout of a site.
Separation (of content and presentation) also provides other benefits, especially as far as semantics (meaning) and structure of pages are concerned. A well-engineered webpage, for example, consists of a hierarchal arrangement of headings; while keywords are marked as strong, and emphasised words are marked as such. This not only makes the webpage more pleasant for both visitor and webmaster, but also aids accessibility (a web browser for the blind could read emphasised words as such; but italic words have no meaning).
Separation of content and layout is not only a good thing in web design. The concept also applies to software. If we separate Control (the modules performing all the logic and processing in the program) from the User Interface (i.e. the program does not directly output data, but calls methods in a User Interface module which output data), it is very easy to make changes to the interface.
For example, we can completely replace a CLI with a GUI by just changing the user interface module, and this would not affect the actual program at all. Also, it would be easy to update the interface.
The previous two sections have shown the effectiveness of separation of content and presentation in documents and programs. Presentation, in fact, is not a core part of the content or functionality we want to achieve. Content or functionality can exist whatever form (layout/presentation) we choose to give it.
Consider an HTML document where presentation has been rightfully moved into a CSS file, so all we are left with is the content. Every HTML document must consist of two sections: head and body. The body is the actual content, while the head is information about the body (metadata - data that describes other data).
Now consider a C++ class, where the declaration of the class (which includes method prototypes) is in a header file, and the actual method implementations are in a C++ source file. The declaration can be considered a 'head', while the implementation is a 'body'.
This concept of head and body can be extended to many different things. I am calling it the Holistic Theorem because nothing is whole without a head and a body. In general, a body is the core of functionality or meaning of an entity, while the head contains important information about the entity and may be an interface used to communicate with it.
Separating head and body to some extent helps just like separating content and presentation does. Head and body cannot be totally insulated from each other like content and presentation, but having a well-defined head and body allows programs and data to be more organised.
This suggests that all files, whether data files or programs, have their own head and body.
The Model-View-Controller (MVC) paradigm used in software engineering recommends the separation of model (data), view (presentation) and controller (logic). One might think that the Holistic Theorem presented above is very similar to the MVC.
However, the Holistic Theorem is not about the interaction or insulation of data, presentation and logic. What it really suggests is that both data and logic have their own head and body, even though said head and body are very different for data and logic.
One might also note that presentation is not included in the Holistic Theorem. This is because it has no place in the theorem. Presentation has no head and no body; in essence it is not part of anything with meaning (data and programs); it is an artifact of our imagination; it does not exist.
We can include presentation between Programs and Data in the diagram above. However, this merely results in a copy of MVC. Also, it is not part of the "Files" hierarchy, nor is it divisible into head and body, as stated earlier.
© Daniel D'Agostino 2006 - 2007