Autoconfigure services with decorators #548
sgomez
started this conversation in
Show and tell
Replies: 1 comment
-
Hi @sgomez , Nice work there! I don't see any drawbacks. I personally like to use declarative containers, but it's a question of choice – nothing wrong with using dynamic containers. As a next step, it would be interesting to look at overriding in testing. Best, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi people,
I did a demo to try to autoconfigure services using decorators with a DynamicContainer.
You can add factories automatically with
@service
and command handlers (dict provider) with@command_handler
.It works but I'd like to read comments or drawbacks about the suitability of this solution.
https://github.com/sgomez/demo-python-di-with-autoconfiguration
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions