Advanced programming


The easiest way to store multiple references to other ACComponent instances is a List of ACRef<T>-instances:

public List<ACRef<ACComponent>> MyRelations {get; set;}

[ACPropertyBindingSource(100, "Configuration", "en{'RefToComps'}de{'RefToComps'}", "", true, true)] public IACContainerTNet<List<ACRef<ACComponent>>> MyRelations { get; set; }

 

However, it is often the case that an instance from different aspects is related to other instances. For Example:

  • Physical relationships (paths)
  • Logical relationships
  • Functional relationships

To be able to store them in separate lists and present them to the surface, there is the principle of connection points, which is explained in more detail in the following section.


The base of all Connectionpoints is the interface IACPoint<T>.

An IACPoint is used to abstractly describe the relationships between any object. It is called a Connectonpoint because in graph theory objects are represented as points and relationships as lines. Using this abstract interface, iPlus is able to graphically represent any relationships between objects (e.g. workflows, visualizations, routes...). The relationships are stored in the IEnumerable<T> ConnectionList property.

The iPlus framework provides a number of different implementations of an IACPoint<T>. The most important implementations are explained in the following sections and chapters:

If the implementations listed earlier are not sufficient for your use cases, you can program a class yourself that implements the IACPoint<T> interface.


The class PAPoint is a Connectionpoint that represent physical relationships between components. The physical relationships are configured in the development enviroment and stored in the database-table ACClassPropertyRelation. The ACPostInit()-Method reads ACClassPropertyRelation (where ConnectionTypeIndex == Global.ConnectionTypes.ConnectionPhysical (11)) and creates instances of PAEdge for each relation.

PAEdges are stored in the ConnectionList. One PAEdge-Instance exists always in two different Connectionlists. One in a PAPoint, that represents a source and one in another PAPoint, that represents a target.

This two-way connection allows you to define a network of physical paths in which you can search for targets in both directions. This pathfinding algorithms are implemented in the class ACRoutingService which uses this kind of Connectionpoints.

 

In the source code above, you can see that the ACPropertyConnectionPoint attribute class is used above the declaration of the PAPoint. This is necessary so that the iPlus runtime can detect which PAPoints are defined in the class, so that the same connection points and their relationships can also be created in the Proxy-Instance.