With the Associative Framework you can create AutoCAD drawings/models in which objects are associated with each other and interact with each other. When properties of some objects in the drawing change, all other objects that depend directly or indirectly on the changed properties of these objects are automatically updated. Only the objects that need to be updated are actually updated, and are updated I the correct order. This reduces the need for ad hoc use of AutoCAD reactors to achieve similar goals, and represents object relationships in uniform, structured and controlled way. All applications that build upon the Associative Framework, including core AutoCAD functionality, behave uniformly and update the objects in uniform manner.
The main building block of the framework is the concept of an action, represented by AcDbAssocAction class. An action is an algorithm that when executed, takes some input, performs the calculations and produces some output. Actions usually take their input from properties of AcDbObjects in the drawings; the output of the actions usually means changing properties of some other objects in the drawing. The dependency of an action on a property of an object is represented by AcDbAssocDependency class.
When properties of the input objects change, the action is notified and later evaluated; its evaluation changes properties of the output objects. This effectively establishes a relation between the objects in which the output objects depend on the input objects. There may be actions whose output objects serve as input objects to some other actions. In this case the former actions need to be evaluated first, they change properties of their output objects, and then the latter actions use the updated properties of these objects. This establishes (partial) ordering between actions. Actions are congregated in networks that are a generalization of a directed acyclic graph, and are represented by AcDbAssocNetwork class. The AcDbAssocNetwork is itself an action, allowing to represent hierarchical associative structures.
When a property of an object changes, all actions that depend on it are notified, but the actions are not immediately evaluated. The evaluation of all actions that need to be evaluated happens later when explicitly requested. A typical time when AutoCAD requests the action evaluation is at the end of each command, or during dragging, on every drag sample. The action evaluation updates output objects of the actions, thus effectively maintaining the relations between the objects in the drawing.
Actions themselves can keep state, but in many cases they are more or less stateless algorithms and the state is kept in objects/entities in the drawing. Thus generally the state of the drawing is kept in AcDbObjects/Entities, the behavior/intelligence is kept in AcDbAssocActions and the connectivity is represented by AcDbAssocDependencies of the actions on the objects. The AcDbAssocNetwork keeps the actions together, but it does not keep the objects/entities. The objects/entities are kept by their respective owners, such as by AcDbBlockTableRecords, AcDbDictionaries, etc
There are a few derived action classes provided directly in ObjectARX. The AcDbAssocVariable is an action that has a name, arithmetic expression, and current value. The AcDbAssoc2dConstraintGroup is an action that represents relations between AutoCAD entities in the form of 2d variational constraints, such as stating that two lines are parallel, or that the distance of the center of an arc from the midpoint of a line is defined by a formula, such as d2=d1+a.
Applications can derive their own action classes to implement custom behaviors and relations between built in or custom objects. When custom behaviors are implemented this way, instead of using reactor mechanism as it was done previously, the custom behaviors seamlessly plug themselves into the associative mechanism. They are then automatically evaluated at the end of each command, evaluated on every drag sample, can request being cloned when the objects they depend on are cloned, etc.