Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mookid8000/f.t.windsor
Experimental augmentation of Castle Windsor to take greater advantage of the container when extending it
https://github.com/mookid8000/f.t.windsor
Last synced: 5 days ago
JSON representation
Experimental augmentation of Castle Windsor to take greater advantage of the container when extending it
- Host: GitHub
- URL: https://github.com/mookid8000/f.t.windsor
- Owner: mookid8000
- Created: 2011-08-09T18:29:47.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-08-10T07:42:05.000Z (over 13 years ago)
- Last Synced: 2024-04-15T02:50:38.702Z (7 months ago)
- Language: C#
- Homepage:
- Size: 1000 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
What?
====`FtwFacility` is a facility for the excellent [Castle Windsor][3] that addresses one of its few shortcomings: The nifty `IHandlerSelector` and `IHandlersFilter` hooks are not registered in the container, they are instances provided to the container at registration time, and thus cannot take advantage of autowiring, lifestyle management, etc.
Therefore, `FtwFacility` goes on and adds to the kernel one single implementation of `IHandlerSelector` and `IHandlersFilter` that has access to the kernel, allowing it to pull handler selectors and handler filters from the container.
With `FtwFacility`, you can register `ISelectHandlerFor` and `IFilterHandlersFor` implementations and have them resolved and called whenever `TService` is either `Resolve`d or `ResolveAll`d.
Why?
====Like I said: Your usual handler selector/filter is not pulled from the container. With this facility, you can hook into the same places _with components from the container_.
How?
====Reference F.T.Windsor from your project and
var container = new WindsorContainer();
container.AddFacility();
before adding any selectors to the container.
From then on, you can do this:
container.Register(Component.For>().ImplementedBy(),
Component.For().ImplementedBy(),
Component.For().ImplementedBy());var someService = container.Resolve();
in order to choose among handlers for `FirstImpl` and `SecondImpl` when resolving `ISomeService`, and this:
container.Register(Component.For>().ImplementedBy(),
Component.For().ImplementedBy(),
Component.For().ImplementedBy());var services = container.ResolveAll();
in order to pick & choose & order the list of handlers invoked when resolving multimple implementations of `ISomeService`.
More info
====Contact me [through Twitter][2].
License
====`FtwFacility` (or F.T.Windsor) is [Beer-ware][1].
[1]: http://en.wikipedia.org/wiki/Beerware
[2]: http://twitter.com/#!/mookid8000
[3]: http://docs.castleproject.org/Windsor.MainPage.ashx