Domanda

On slide 19 in a presentation Margaret Hamilton describes three primitive control structures. My goal is to reduce the probability of errors in my code by working with this "design framework". I am wondering if someone could explain to me how these structures work. Perhaps someone could point me to a simple implemented example in code.

È stato utile?

Soluzione

These three "primitive control structures" are ways to describe the ways in which a manager (superior) and two (or more) worker (subordinate) procedures coordinate their work.

The Join primitive shows that the manager calls A with some arguments, A returns some values, and then the manager calls B with A's results. A's output parameter signature matches B's input parameter signature.

The Include primitive is essentially a scatter/gather technique. The manager partitions the work between A and B, and gathers up the results. The subordinates have different parameter signatures and do different things.

The Or primitive is a decision-making process in which one of the subordinates is chosen based on a partition function to select the child. The subordinates have identical parameter signatures.

She is using these primitive design patterns to impose a very strict layered architecture on the software.

It helps to remember that the Apollo development program started, ran, and essentially ended BEFORE Dijkstra wrote "The Structure of the T.H.E Multiprogramming System", which laid out the fundamental concept of layered designs, and incidentally introduced semaphores for mutual exclusion. Recall that Apollo 7, the first manned Apollo flight, was in 1968, and Apollo 17, the last Apollo flight to the moon, was in December 1972.

Altri suggerimenti

Looking at the slide, its less a system of functions that returns multiple outputs and more a message passing system. If you write an object that can receive and return messages, it can return multiple outputs by simply returning multiple messages. In their case though, the messages that are returned are ordered, unlike most message-passing systems that are asynchronous, and the systems are built up in a strict tree structure. IT reminds me of a scenegraph.

Go look at message bus architectures for more information.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
scroll top