ion-cli icon indicating copy to clipboard operation
ion-cli copied to clipboard

Add support to generate builders in code generation

Open desaikd opened this issue 1 year ago • 0 comments

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.

Implementation checklist for programming languages:

  • [ ] Rust
  • [X] Java

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

desaikd avatar Apr 09 '24 22:04 desaikd