As an alternative to the aspect-oriented implementation of mutual properties, property binding can be proposed. In LibPropC++ C++ library it is implemented too.3
Some weakness in the LibPropC++ (with property binding):
There are two types of binding. One-way binding should be applied when one of the properties is read-only. In other cases, two-way binding must be applied.56
Infinite loops can be eliminated by blocking the signal, or comparing the assigned value with the property value before assignment, or eliminating unnecessary assignments.78
Binding properties of different types can be achieved through type conversions.910
Binding properties with transformations can be achieved through reducing the transformation function to the problem of binding properties, and the function can be imaginary consider as Type Conversions.1112
13
Properties are being kept synchronized automatically. Between library calls they always have the values expressed by the EqualityConstraints.14
Property changes watching mechanism acquires some resources.15
Code sketch for one-way binding may look like as follows:
16
Two-way binding can be expressed as follows (in C++):
17
Accomplishing the binding (i.e. connecting the property change notification in an event handler) may be like as follows:
18
"Binding Properties". Cunningham & Cunningham. Cunningham & Cunningham. Retrieved 4 February 2015. http://c2.com/cgi/wiki?BindingProperties ↩
Porton, V. "Binding together Properties of Objects". Victor Porton. Retrieved 25 February 2021. https://cloudflare-ipfs.com/ipfs/QmNj5xHJx9JEWfPAttTTitXnjFKwm319nLZU8BfAoMwx9h/ ↩
Evermann, J., The Association Construct in Conceptual Modelling - An Analysis Using the Bunge Ontological Model, Wellington, New Zealand: School of Information Management, Victoria University ↩