Shortcut to instantiate classes. #114
Closed
proofit404
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
@proofit404!!! Good to see you! Your suggestion is basically #94, no? 😇 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Let's say we have a service with high level business logic:
To get an instance of this service I would have to define custom factory and manually take all constructor arguments by type from containers.
This is repetitive and requires to change factory every time I change services class init signature.
I would suggest either
registry.register_class(Subscription)
to be similar toregistry.register_value(str, "Hello World!")
initialize
helperregistry.register_factory(Subscription, initialize(Subscription))
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions