-
-
Notifications
You must be signed in to change notification settings - Fork 154
Multibinding #164
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
Multibinding #164
Conversation
Hi, you were faster than I ecpected :-) What isn't clear to me what is the benefit of registering several instances into a set compared to just register a Set object that contains all the instances you need? |
In a situation where I register Set with all instances I need to know them all. Every time I create a new implementation, I have to remember this place and add it to the Set. You could use multibinding to implement a plugin architecture, where each module has no idea about each other and does not require changes in several places each time. An example situation. We want to clear all data when logging out. The class responsible for this action (eg. All of this allow us to write clean code that is compilant with SRP. |
Hmm, but wouldn't it then make sense not to have to pass a inToSet and just search registered types that fit the type? |
The solution with |
You always could use different names to register different instances. |
I guess that requires the use of a reflection, right? So collecting instances in to Set will be on runtime? |
Not refelction, but it would require ireating over all registered objects in getit and make 'is' test. |
Proposal for implementation of multibinding feature.
All changes have no effect on the current implementation. Everything is controlled by the
inToSet
flag. If flag is set tofalse
, the library works the same like before the changes.Discussion #75