Skip to content

Further configuration polish #927

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

Merged
merged 2 commits into from
Feb 14, 2022
Merged

Conversation

metacosm
Copy link
Collaborator

  • refactor: DependentResourceManager now configures DependentResources
  • refactor: remove DesiredSupplier since it makes things less readable

This makes it possible to pass a configuration DependentResource
implementations and removes the need to initializers.
@metacosm metacosm self-assigned this Feb 11, 2022
@metacosm metacosm requested a review from csviri February 11, 2022 17:40
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 23 Code Smells

29.4% 29.4% Coverage
0.7% 0.7% Duplication

@csviri
Copy link
Collaborator

csviri commented Feb 11, 2022

  • refactor: DependentResourceManager now configures DependentResources

@metacosm why coupling configuration abstraction with DependentResource resource? don't see gain for that. Especially since the base level contains these 2 objects:

Class<? extends DependentResource<R, P, ? extends DependentResourceConfiguration<R, P>>> getDependentResourceClass();

  Class<R> getResourceClass();

Where the resource class is already in the interface (see getResourceType), and and the getDependentResourceClass is the current class where we are putting this.

The other configs, could be just solved with an adaptor to a nicely polished config builder (will work on that on monday).
In addition to that the whole point of the controller was to not do this, in the first place, so to have the configuration service independent.

Just to be clear the main objection is put such configuration abstraction to DependentResource interface. This should not be forced.

  • refactor: remove DesiredSupplier since it makes things less readable

The supplier was there so the user is not forced to create subclasses, this is something we can discuss. But it makes nice to share the context between the implementations. AFAIK this we defintelly loos with this, while the desired could be overriden also before.

@csviri
Copy link
Collaborator

csviri commented Feb 13, 2022

refactor: remove DesiredSupplier since it makes things less readable

Actually this might not be that much problem, since if its standalone the reference to other resource could be passed to it. So basically same as the context of the supplier.

@csviri csviri merged commit 6e2153f into configuration-polish Feb 14, 2022
@csviri csviri deleted the further-configuration branch February 14, 2022 09:46
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

Successfully merging this pull request may close these issues.

2 participants