Hello!
I would like to have multiple ways of instanciating a class, like you would overload a constructor in C#.
What is the best/clean way to define multiple contructors (i.e. multiple Create operations with different signatures) in Gamma?
It seems the definition patch won’t let me have multiple operations named “Create” so I’m working around that with versions - for instance “Create (Empty)”, “Create (Spread)”, “Create (MutableArray)”…
which seems to work fine, but once in the parent patch there is still an input on the “Create (WhateverVersion)” nodes which leads me to think there are not recognized as a proper constructor, but just a regular operation, which (as far as I understand) will create a new instance if no reference is input.
Is there any drawback to proceeding like this, or is there a cleaner way?
Also, instead of creating a dedicated “Create (Empty)” version, is there anything wrong doing just this in the parent patch?
Thanks so much for your insights!
++
T