tschneidereit / SwiftSuspenders

NOTE: Find the offical repo at http://github.com/robotlegs/swiftsuspenders
https://github.com/robotlegs/swiftsuspenders
MIT License
280 stars 89 forks source link

Restrict access to mappings for child injectors #45

Closed vizio360 closed 12 years ago

vizio360 commented 13 years ago

Is there a way to restrict access to some mappings for child injectors?

so to have some private mappings in the parent injectors which are not accessible by its children?

This came up because right now we are facing that situation.

We have some singletons which should stay private in the context of the main application but some other which should be available for the children.

Could it be a good idea to add this functionality?

tschneidereit commented 13 years ago

Mmh, that's an interesting idea. Some sort of access control mechanism would be required. Although, in the simplest implementation, that would probably boil down to a "don't propagate to child injectors"-flag.

I'll think about it some more and see if it can be implemented efficiently.

neilmanuell commented 13 years ago

I had a similar thought. I am using Child Injectors for Modular development. It would be good to be able to suppress injections of actors that should only be accessible to (for example ) the shell.

tschneidereit commented 12 years ago

This is supported using map(type).local() in Swiftsupenders 2.