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

Investigate splitting ConsulFactory #77

Open
sleberknight opened this issue May 11, 2023 · 1 comment
Open

Investigate splitting ConsulFactory #77

sleberknight opened this issue May 11, 2023 · 1 comment
Assignees
Labels
investigation Something that needs to be investigated before implementation can proceed

Comments

@sleberknight
Copy link
Member

sleberknight commented May 11, 2023

Note that the ConsulFactory implementation has equals and hashCode even though it doesn't seem like you would ever need to compare two ConsulFactory objects. I do not plan to add these new properties to the existing equals and hashCode methods, and after seeing these methods am considering several future changes:

  1. Split ConsulFactory into separate classes, one that contains only configuration, and one for taking that configuration and building the Consul instance.
  2. Remove equals and hashCode from the factory class
  3. Maybe make the configuration class a "value" or "data" class, where it would (maybe) make more sense to have equals and hashCode
  4. Change all the Optional handling across the library, i.e. don't declare fields as Optional and don't pass Optional to methods, etc.

This would be a somewhat large design change, since it would change public APIs. Then again, since we have not released this yet under kiwiproject, we don't need to adhere to the original APIs, at the cost of a little migration pain (in our own services).

Originally posted by @sleberknight in #23 (comment)

@sleberknight sleberknight self-assigned this May 11, 2023
@sleberknight sleberknight added the investigation Something that needs to be investigated before implementation can proceed label May 11, 2023
@sleberknight
Copy link
Member Author

We now have released this library under kiwiproject, so the original comment is no longer valid regarding changes to public APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation Something that needs to be investigated before implementation can proceed
Projects
None yet
Development

No branches or pull requests

1 participant