Windsor Castle model
I use Windsor Castle quite a while now. It is just perfect for environments where data is located in a database or the like, where the repository pattern or the unitofwork pattern do work well.
Now I do have a different situation: I have a complex object model that is assembled by a lot of single PONOs. The environment is strongly influenced by COM, to make it more explicit: Excel, Word PIOs are heavily used.
I do use the command pattern, I implemented the ICommandHandler like described here but with one difference. As I do want to assembly commands to a list of commands to call them in a run without knowing anything beside the general command pattern described, it does not make to introduce the context when calling the execute method. So the interface does look like this:
public interface ICommand { void Execute; bool CanExecute; }
Execution of commands with that interface is effective and easy to understand. On the other hand it is a problem to introduce the context with the ctor because therefore the Container must be called explicitely to e.g. add ctor parameters.
So I actually have two questions:
- Is it possible to inject a - let's call it a context, a part of the object model - automatically by Windsor castle without calling the container explictely?
Video on topic: Windsor Castle model
Share this Post
Related posts
Windsor Castle video
Here’s one of my favourite activities to get students interested in Windsor Castle. The lesson is based around the ‘visit…
Read MoreRMS Windsor Castle
History Name: RMS Windsor Castle Owner: Union-Castle Mail Steamship Company Port of registry: Route: Southampton-Las Palmas-Cape…
Read More