Skip to content

instanceName "highly not recommended" #282

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

Closed
davidsowerby opened this issue Jun 23, 2022 · 3 comments
Closed

instanceName "highly not recommended" #282

davidsowerby opened this issue Jun 23, 2022 · 3 comments

Comments

@davidsowerby
Copy link

Hi

Firstly, thanks for this package - I find it incredibly helpful.

I am a bit confused, though, about the use of the instanceName option. It is "highly not recommended" as in the extract below, and yet it was put forward as a possible solution in #272.

There is presumably a risk attached to using this option, but the docs do not give any indication (that I can find) what that risk might be. Could you explain the concerns?

  /// [instanceName] if you provide a value here your instance gets registered with that
  /// name instead of a type. This should only be necessary if you need to register more
  /// than one instance of one type. It's highly not recommended.
@escamoteur
Copy link
Collaborator

escamoteur commented Jun 23, 2022 via email

@davidsowerby
Copy link
Author

Thanks for the very quick response.

I would say that it is more than a bit extreme ! Your explanation here makes good sense, and I can see that it might be open to abuse.

However, the severity of the warning may also be having a detrimental effect - in my case I created an unnecessary work around to avoid using a named instance in case it broke. But with your explanation here, I can see that my use case is valid and I did not need the work around.

@escamoteur
Copy link
Collaborator

Sorry for the late response, I had to take a longer break due to health issues. After I used the instance name now in my own project, I have to agree, there are cases where it's the perfect solution. I removed the warning from the docs

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

2 participants