Recursion Example

divider

A simple example of recursion is a manufacturing company that makes a ball point pen.

The ball point pen in made up of four components:

  1. The refill, (which itself has components, called a sub-assembly),

    1. A plastic tube in which the ink resides,
    2. the ink,
    3. the metal tip at the bottom of the tube in which the ball resides,
    4. the ball.

  2. the cylinder in which the refill resides,

  3. a top cap that plugs the top of the cylinder.

  4. a bottom cap that protects the refill tip and sports a clip for holding the pen in a shirt pocket.

A hierarchy picture of this:


Finished good, Pen
            |

refill   cylinder   top cap   bottom cap
  |

tube   ink   metal tip   ball


In order to find the low-level cost to the company of manufacturing the pen, we need to find the cost of each component and add those costs together.

For the non-Tymeac environment, this is a nightmare. The simple process to get the cost of the refill must now "save its storage, pointers, etc" and execute another process to compute the inner costs. It is tedious, time consuming and the chaining of storage areas has lead to more storage violations and exceptions then are countable. (Also, for every other application where recursion is necessary, the programmers must develop a custom solution.)

divider

For the Tymeac environment, this is a piece of cake. One sets up:

  • eight Tymeac Queues -- one for each of the four top-level get-Cost processes and one for each of the four sub-assembly, (refill), get-Cost processes,
  • two Tymeac Functions -- one for the list of top-level Queues necessary to complete the request and one for the list of the sub-assembly, (refill), Queues necessary to complete the request.

The client uses a call for the top-level Tymeac Function to process the request.

The top-level process to get the cost of the refill simply uses a call for the sub-assembly Tymeac Function to process the inner request.

The saving/restoring, coordinating, timing, scheduling, monitoring, and managing are handled by Tymeac.

The system architect can concentrate on solving business problems.