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

Uses addFactories rather than withFactories in the BinderFactory. #991

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

archolewa
Copy link
Contributor

-- In the current behavior, if someone wants to add their own custom
Metric Factory, and they naively overrwidw getMetricFactories to
return Optional.of(<Just-My-Factory>), Fili will drop all the
current mappings and add just the one the user provided. So if the user
wants to maintain the defaults, they have ot manually add them in
getMetricFactories.

This makes the most common use pattern (customers add a few custom
metricMakers or dimension types, but otherwise wants the defaults
available) very cumbersome. It is also, I would argue, very unintuitive.

-- With the new behavior, custom metrics created by the user will be
added to the already existing registry. So customers don't have to
worry about losing the defaults because they added a few customs.

If users want to override a default, they can register a
new factory under the same name. If customers really want to drop all
the defaults, well then they can override getConfigurationLoader. A
bit cumbersome, but highly unlikely.

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

-- In the current behavior, if someone wants to add their own custom
Metric Factory, and they naively overrwidw `getMetricFactories` to
return `Optional.of(<Just-My-Factory>)`, Fili will *drop* all the
current mappings and add just the one the user provided. So if the user
wants to maintain the defaults, they have ot manually add them in
`getMetricFactories`.

This makes the most common use pattern (customers add a few custom
metricMakers or dimension types, but otherwise wants the defaults
available) very cumbersome. It is also, I would argue, very unintuitive.

-- With the new behavior, custom metrics created by the user will be
*added* to the already existing registry. So customers don't have to
worry about losing the defaults because they added a few customs.

If users want to override a default, they can register a
new factory under the same name. If customers really want to drop all
the defaults, well then they can override `getConfigurationLoader`. A
bit cumbersome, but highly unlikely.
@michael-mclawhorn michael-mclawhorn merged commit 18e312b into master Nov 15, 2019
@michael-mclawhorn michael-mclawhorn deleted the use-add-for-reals branch June 8, 2021 22:36
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