Skip to content

Provide fluent nested builders for model objects. #137

@iocanel

Description

@iocanel

Currently, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions