Document Actions

Connectors

by Aram Tadevosyan last modified 2003-08-29 16:58

Connectors are first order elements in VCB design. In contrast to UML where links are parts of objects (e.g. object references), connectors are independent and parts can be re-linked without affecting part implementations.

Connectors enable Anonymous Collaboration among parts, which is a fundamental principle for Circuit Board designs. It means that two or more parts are using each other without knowing about the other. Parts are independent and there are no dependencies, which are hard to manage, and which essentially reduce the level of reuse. Connectors replace the standard “method call” mechanism to another one more suited to high reuse.

Connectors perform two main functions. First they forward events fired by parts, and second then perform necessary transformations.

When part fires it outpin it produces a bundle of data. These bundle need to be forwarded to other parts according to the connectors. It could happen that one outpin is connected with several inpins and as such the data need to be replicated and forwarded to these inpins independently without guaranteeing any order. Actually it may also create potential for paralleling of the processes.

The data produced and required by pins we call pin parameters. It could be collection of primitive types and/or (later) some serialized objects and even streams (e.g. XML streams). Then when user connects two pins it may happen that order and number and even types of output and input parameters will be different. Then he should setup the necessary mapping and transformations, which will be a property for the current connector.

So connection setting may require mapping of the input and output parameters. The following scenarios are possible during the mapping:

  • When order is different. The user indicates that, for example, input parameter #1 corresponds to #2 output one and so on for all input parameters.
  • When types are different. When we have widening transformation e.g. from short to long then it happens automatically, in case of narrowing user should confirm the transformation
  • It could happen that there is not appropriate output parameter for an input one. Use may assign constant value for that input parameter.
  • At some extreme it could be that all parameters are constant so it is part initialization. That means connectors is connected only to the part inpin and the outpin is absent (or constant part).
  • if we have several initializations we need to setup the order when sequence of initialization is important.

Another interesting issue, related to the connectors, is that it is not required that parts reside in one container. They can be distributed and the connectors can forward events between containers which are located on remote servers. So we can have distributed and parallel computing but just changing configuration parameters.