Reply To: "Default value for parameter", serialization, and 2.7 / 2.8 differences

FlowCanvas Forums Support "Default value for parameter", serialization, and 2.7 / 2.8 differences Reply To: "Default value for parameter", serialization, and 2.7 / 2.8 differences

#1775
kalms
Participant

Or, alternatively: abolish the current ‘default’ concept. When a node is added to a flow graph, all of its parameters will be given values somehow (typically assigned the constructor default values), and all these values will be saved by serialization. This ensures that old flows don’t change functionality when someone changes default values.

With that model, the developer of a new node type could still specify defaults for a value through some mechanism, but it should only be applied when the user adds new nodes, or the first time that a user loads an old graph which does not include values for all the inputs which exist in the latest version of a node.

The ‘default value’ concept i described here last is different from the default function argument concept that is used in C# but I think this variation maps better to visual programming languages. It also has the benefit that there is no need for a ‘set’ / ‘not set’ kind of flag separate from the actual value.