robotlegs / robotlegs-framework

An ActionScript 3 application framework for Flash and Flex
https://robotlegs.tenderapp.com/
MIT License
967 stars 261 forks source link

IInjector#getProviderFor #142

Open creynders opened 11 years ago

creynders commented 11 years ago

See http://knowledge.robotlegs.org/discussions/robotlegs-2/2124-mapping-multiple-interfaces-to-same-singleton-instance

and #136

creynders commented 11 years ago

Or come to think of it, neatest would probably be:

injector.map(IFoo).toSingleton(Foo);
injector.map(IBar).toProviderOf(IFoo);
creynders commented 11 years ago

Spiked

What ya think @darscan ?

peterjoel commented 11 years ago

Or:

injector.map(IFoo).and(IBar).toSingleton(Foo);

Or:

injector.mapAll(IFoo, IBar).toSingleton(Foo);
creynders commented 11 years ago

@peterjoel yeah, I like the first one, but that might be a bit hard to implement.