-
Notifications
You must be signed in to change notification settings - Fork 12
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
DIP Violation #28
Labels
Comments
Hi! That is great suggestion! I'm working on the next Brandi version and will try to implement that. |
vovaspace
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
labels
Oct 14, 2022
This is actually what I'm doing in my library usage of brandi. I'm exporting a set of tokens, a dependency module, and a default set of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Hey, @vovaspace
This line violates Dependcy Inversion Principle:
brandi/docs/reference/dependency-modules.md
Line 79 in 08a4748
The ES-module with definition of
ApiService
class depends on infrastructure layer: your librarybrandi
and on the module structue:TOKENS
.Just move this line to the composition root and everything becomes well again:
All dependency resolution rules should be placed in single place: composition root (see: Dependency Injection Principles, Practices, and Patterns by Steven van Deursen and Mark Seemann)
And if you are going to move it to the composition root, just add the
inject
parameter to the container methods:toFactory
andtoInstance
:The text was updated successfully, but these errors were encountered: