What we did was to make a static application class with a reference to a configuration object which is only loaded once at application start. The application class initiates the configuration object by running a xaml file through the xaml parser. This is a very pragmatic solution that can be used for initialization of static objects in the application. Everything is hooked together with very little code and it can easily be extended to support more objects etc. in applications using the framework.
When the user needs access to any of the injected object he can do like this:
Application.Config.DaoFactory
Although this only supports "singleton" objects it gives me the flexibility I was looking for.
If you crave a little more inversion of control, I can recommend the Windsor Container.
ReplyDeletehttp://castleproject.org/container/index.html
I've used it a couple of times and works like a charm :)