Jonas Kello
Jonas Kello
I'm also looking to do this. If I understood correct, the dart2js bug appears to have been fixed in 1.7. So just wanted to get an update on this feature,...
Any news on this? I think maybe it is blocked by the issue below? https://code.google.com/p/dart/issues/detail?id=12921
Well basically every case where you have alternative implementations of an interface and want to pick one at run-time. One example may be that you have a logger interface that...
Ok, but I was hoping to achieve this without annotations. In general I think annotations is a bad idea since they spread your framework specific DI concerns across the whole...
Just to clarify. Of course you need some code to be aware of the key but I much rather encapsulate this in something like a factory than maintain annotations across...
From using DI in C# over the last years think this is the pattern that has emerged: 1st generation: Using XML files to specify registrations and injections (eg. early StructureMap...
To be more specific about the problem with the suggested annotation solution. If you have 100 classes using the logger and you want to switch implementation you will have to...
Well, I would not need the annotations unless the DI framework required it, which in IMHO makes it a DI framework specific concern. Compare with persistance ignorance for persistance frameworks....
Actually if it was possible to do a non-annotation abstraction that would allow any object to be used as key that would be even better. This could help avoid magic-strings...
I tried your sample and did some experiments. It seems what I want to do is already possible. This code works now but not sure if you will support it...