In the design of diagram Node elements, the node's position is stored as a two node properties, x and y respectively. This has the advantage of simplifying the encoding and decoding of diagrams, since position values get serialized like all other node attributes. However, this insignificant advantage comes at a great cost:
The x and y properties are "special" because they should not be handled by the property sheet, thus requiring a whole mechanism to handle invisible properties.
It means the Point class cannot be immutable (as it should), because properties have to be mutable.
We can greatly simplify the design of the code by not storing a node's position using properties.
In the design of diagram
Node
elements, the node's position is stored as a two node properties,x
andy
respectively. This has the advantage of simplifying the encoding and decoding of diagrams, since position values get serialized like all other node attributes. However, this insignificant advantage comes at a great cost:x
andy
properties are "special" because they should not be handled by the property sheet, thus requiring a whole mechanism to handle invisible properties.Point
class cannot be immutable (as it should), because properties have to be mutable.We can greatly simplify the design of the code by not storing a node's position using properties.