Structured Assembly Principles

December 29, 1997 - Jack Harich - happyjac@mindspring.com

As we architect and build the Bean Assembler (BA), is has become obvious we need to review the high level requirements of what a good BA would try to accomplish. Attempting to identify the principles of assembling a good system from parts seems the right place to start. It certainly appears that something as radical as the BA needs a fresh foundation.


Introduction

Just as Structured Programming greatly improved individual programs, Structured Assembly (SA) improves systems assembled from parts. The goal of SA is "good system structure". A system having good structure will exhibit these traits:

It follows that a good SA tool will provide "good system structure" at all times, plus it should make the process efficient and enjoyable.

It also follows that SA principles can be derived from the pursuit of the above goals. To put this in perspective, lets review the principles of Structured Programming, originated by Edsger Dijkstra in 1969:

Another similar contribution was Structured Design, first described in 1974, and made up of these practices:

As you can see, Structured Design was not nearly as focused on principles as Structured Programming, but attempted to provide a process or smorgasbord of best practices. It made valuable contributions but failed to take root, since no one process has yet proved to be superior. Thus as we develop the theory behind Structured Assembly we should be careful to stick to principles, and eschew sneaking in process or best practices. If these are needed then that should be a separate topic, since they are highly subject to change and appropriateness. Principles, on the other hand, tend to be stable and highly appropriate.

"System" here means a discrete collection of objects that perform a particular mission. We exclude large, complex systems such as enteprise IS systems, the WWW, operating systems, etc. We are more concerned with applications and collections of applications.


Principles

Organization

Collaboration

User Expression


Corollaries and Observations


Event Mechanism

This is so crucial that we must get into detail. A reasonable approach is:

Provide a EventService worker for each container. Workers needing event notification from workers in their container can subscribe directly to those workers. Workers needing event notification from containers in their container or their container would use the EventService.

The EventService would be a privileged worker. Using their container's services, they would communicate with other containers to implement the event service.


Sharing Mechanism

Again, this is so crucial that we must get into detail. A reasonable approach is:

Each worker has a "ShareType" property equal to:

Note that sharing occurs explicitly. There is no equivilent of declaring a field as "protected" and then letting all subclasses access it automatically, since this reduces understandability and encourages bugs. Remember, we must follow the principle "Workers can only reference other items in their container."

A shared proxy worker could use a name alias to resolve a name collision. Minimize this since it reduces understandability. It cannot be avoided in old, large systems undergoing evolution.