Windsor Patterns
I have no idea how I missed it so far, but Alex has a set of posts showing all sorts of interesting usage patterns (and design patterns) that can be used with Windsor.
- Part 1 - Simple Configuration
- Part 2 - More Configuration (Arrays)
- Part 3 - Still More Configuration (Dictionaries)
- Part 4 - Switching Configurations
- Part 5 -Configuration Parameters
- Part 6 - Switching between Lifestyles
- Part 7 - Switching between Implementations
- Part 8 - Referencing implementations by key
- Part 9 - Constructor Injection
- Part 10 - Setter Injection
- Part 11 - Factories - This one made go, "Ahhh... Wow!", I didn't know that.
- Part 12 - Decorators
- Part 13 - Injecting Service Arrays - I would rather call it Aggregators instead. Really good idea for pipelines.
- Part 14 - Startable Facility
Good content, and impressive line up. Add an into to IoC at the beginning, a bit about writing facilities and interceptors and you got a full course material in your hand.
Comments
The series is getting there slowly - I suspect I might end up running over the initial 20 post estimate I made... I've yet to cover things like:
Comission/Decomission Lifecycles... and maybe how to add your own ... not sure if it's that valuable to most people though, I've only ever done it once for a project.
Additional lifestyles, and writing your own.
Overloaded constructor behavior (i.e. how the internal voting mechanism chooses a candidate)
The internals of the container, and how to register your own Component model manually.
Writing interceptors (can lead on from the manually registering a component model).
Writing facilities (combining the 2 above)
I guess I was reluctant to call "service arrays" an aggregation, certainly that's the pattern/approach I presented, but I think you could use the same approach for things that don't behave as an aggregation... perhaps an array of "IEventful" services, where in the constructor it just attaches itself to events on each of the services - I'm not sure I see that as aggregation myself... ??
Oh and another thing I haven't covered yet is generics... can you think of anything else worth covering?
You might consider writing about subsystems (how they are different from facilities) and converters.
Wow, great find Ayende. Alex, this is an excellent contribution to the community. Thanks so much!
Converters is a good one, definitely worth covering... and yeah subsystems is also important, I quite like subverting the resource subsystem for my own needs ;o)
I'll add it to my list...
...Considering I meet up with Alex H once a week for the Ellerslie chapter Architecture Chat in Columbus, it is kind of embarrassing that I had to get this via Ayende, seems Alex has put together a great series of post on using Castle's Windsor container...
This method can be used for several way, in the case you presented, it is used for aggregation, the eventful case is used to pass data.
I would like to think about the two as two separate use-cases, with common implementation.
Too early in the morning to think about missing patterns, I'll get to that.
Comment preview