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

RFC: Refactor resourceFactory #300

Open
amorenoz opened this issue Nov 30, 2020 · 0 comments
Open

RFC: Refactor resourceFactory #300

amorenoz opened this issue Nov 30, 2020 · 0 comments

Comments

@amorenoz
Copy link
Contributor

The issue of possibly refactoring the resourceFactory has come up a couple of times.

Opening this issue do discuss it. Some discussion topics could be:

  • Should the resourceFactory be a singleton? That seems to be the current intention but I frankly doubt that's the actual case looking at the code:
    func NewResourceFactory(prefix, suffix string, pluginWatch bool) types.ResourceFactory {
    if instance == nil {
    return &resourceFactory{
    endPointPrefix: prefix,
    endPointSuffix: suffix,
    pluginWatch: pluginWatch,
    }
    }
    return instance
    }

If so, how should we deal with the configuration (parameters to NewResourceFactory?)

  • If it is a singleton, should all the modules that need it hold a reference to it and pass it down to their dependent objects or call a global GetInstance() function that returns the global instance?
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

No branches or pull requests

1 participant