amazon-ion / ion-cli

Apache License 2.0
33 stars 15 forks source link

Add support to generate builders in code generation #97

Open desaikd opened 6 months ago

desaikd commented 6 months ago

We should not expose the constructor, if we can help it. Unless we generate overloaded constructors, using a constructor means that adding a new optional field is backwards incompatible. (And if you have two optional fields with the same type, then you've got a pretty good chance of having a method signature conflict.) On the other hand, if we use builders, then the generated order doesn't matter for us or for consumers of the generated code.

I don't think it needs to be solved now, but it does need to be called out as a current limitation, and it needs to be fixed before we can say that it is ready for customers to use.

_Originally posted by @popematt in https://github.com/amazon-ion/ion-cli/pull/95#discussion_r1558377334_