Provide fluent nested builders for model objects.
See original GitHub issueCurrently, the generated model has a builder-like structure baked inside the model objects. Given the depth of the model, it would really help if the builders supported more advanced features like nesting, visitors and in-lining (similar to what we have in the https://github.com/fabric8io/kubernetes-client).
nesting makes it so much easier to create model objects directly in java. It’s faster to write, it’s more IDE friendly etc.
visitors allow making changes, without having to explicitly traverse the object tree. (e.g. allows doing things like visit all Pod Specs in the tree and add a sidecar container
without having to care if the spec is under a Deployment, DeploymentConfig, Pod, ReplicaSet etc).
in-lining allows to use the builder structure but instead of building the object directly to pass the object to a function. This allows to seamlessly integrate the builder into the client dsl.
Now, if we could get those builders either as part of the kubernetes module, it would open up the room of aligning with the https://github.com/fabric8io/kubernetes-client.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:9 (6 by maintainers)
On 02.16.18, Paulo Pires wrote:
Yeah, I do have something working. Will create a pull request shortly.
@brendanburns: I’ve written a generator myself that we used for the fabric8 kubernetes-client. So let’me try to integrate it and see how it goes.