Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Sundrio improvements #5135

Closed
shawkins opened this issue May 16, 2023 · 5 comments
Closed

Possible Sundrio improvements #5135

shawkins opened this issue May 16, 2023 · 5 comments
Assignees
Milestone

Comments

@shawkins
Copy link
Contributor

sundrio/sundrio#368 will cut down on the model jar sizes by around 20% and will also decrease the runtime footprint.

Other possible opportunities to reduce the size of the generated models:

  • suppress the generation of nested builders in places where we're using HasMetadata to represent raw. The available types are usually incomplete as the module and buildable references don't contain all of the types (for example Deployment is missing for Template objects), and the content could actually be free form.
  • 6 methods are generated which contain logic for determining the type / builder per nested collection field. It seems like this could be consolidated to a single method for determining the builder - and/or as discussed with @metacosm we could make all of our model objects Editable and omit the instanceof check for types and let the general builderOf logic catch it.
  • removeMatchingFromXXX are not necessary as we're already dealing with a VisitableBuilder

@manusa @metacosm @iocanel - do any of these seem worthwhile?

@manusa
Copy link
Member

manusa commented May 16, 2023

cut down on the model jar sizes by around 20% and will also decrease the runtime footprint

This is awesome.

Making all models "editable" or "cloneEditable", as discussed in the internal meeting seems pretty useful to me. Not only for our Serialization.clone purposes, but in general as a UX improvement.

shawkins added a commit to shawkins/kubernetes-client that referenced this issue May 16, 2023
@shawkins
Copy link
Contributor Author

Making all models "editable" or "cloneEditable", as discussed in the internal meeting seems pretty useful to me. Not only for our Serialization.clone purposes, but in general as a UX improvement.

Opened #5138 to show what this would look like via the pojo generation logic - this is similar to the lombok toBuilder annotation option.

sundrio/sundrio#376 should make it so that both fabric8 and sundrio can use the same general builderOf logic.

@manusa manusa changed the title Possible sundio improvements Possible Sundrio improvements May 17, 2023
@shawkins
Copy link
Contributor Author

All of the upstream sundrio improvements have been committed. The generated builders will now be streamlined except for the initil consideration mentioned:

suppress the generation of nested builders in places where we're using HasMetadata to represent raw. The available types are usually incomplete as the module and buildable references don't contain all of the types (for example Deployment is missing for Template objects), and the content could actually be free form.

As users may be using one of the available types, it's not worth addressing at this time.

Once a snapshot or release is available I'll update frabric8 to remove our usage of the fluentimpl.

@manusa @iocanel any additional thoughts on adding an edit, or copy, method directly on the pojos we generate - #5138

@manusa
Copy link
Member

manusa commented Jun 15, 2023

@manusa @iocanel any additional thoughts on adding an edit, or copy, method directly on the pojos we generate

seems fine for me

shawkins added a commit to shawkins/kubernetes-client that referenced this issue Sep 11, 2023
@stale
Copy link

stale bot commented Sep 13, 2023

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants