Actionscript 3, code generation.
Finally, default constructors (with no parameters) are only added if generating the whole class not synchonizing.
Yes I understand this point.
Ok thanks to your comment I understood that;
1: advanced code generation has a per class base
2: it can be resetted for a complete package and sub children to default main options.
Following my test:
1: constructor is generated automatically if Options|Source Code Engineering | Object Lifetime | Generate Copy Constructor is ticked
2: the constructor is not displayed automatically into the class element operations list (visual information). It requires that code is generated first, then synchronised. Which is a bit confusing. I'd like, if possible, to see this in the operations list.
But I understand it can be a bit hard to manage because the option change regarding Object Lifetime (possible at any time) should also remove the constructor from the operations list automatically.
Regarding As3 code generation I think that Generate constructor should be always on (to apply best practices).
You could achieve much of your other comments (for an initial generation at least) by modifying code templates. (I'd look at adding a tagged value to the attributes you want set by a constructor, a custom template or two and listing over the attributes looking for that tagged value.)
Ok, so I'll look further into it if I have some time, but I don't know much about the syntax used, so it can be hard to manage by myself, if somebody has written such functionnality, do not hesitate to forward it to me.
By the way, I feel that to add in the attribute dialog of a class element a check box [ ] "set by constructor next" to []Derived []Static [ ]Property []Const might be very useful. If this check box is checked, then EA when it generates the default constructor adds automatically as parameter of the constructor function this variable and even the this.myVariable=myVariable ....
Thank you for your previous detailed answer.
Best regards.
Cedric M. (aka maddec)
http://analogdesign.ch