Hi Jason,

On 25 Set, 14:23, Jason Meckley <[email protected]> wrote:
> you don't need to pass the kernel or container to the MainForm. only
> IApplicationFacade. also if there is only 1 implementation of a given
> interface then you don't need the key either. you're code could look
> something like this

That makes perfect sense. I used to pass IKernel around and switched
to IWindsorContainer in a desperate attempt to resolve my problem.
The MainForm, as well as other partecipants, need the whole container
because they can register other components themselves and/or require
others.

> you should not need many (any?) references to either IKernel or
> IWindsorContainer in the application. If you do need it, IKernel is
> where all the real decision making is done. IWindsorContainer is just
> a wrapper around IKernel. I try to keep IKernel within infrastructure
> code only. Like implementations of SubDependencyReslovers,
> ComponentConstructionBuilders, Handler Selectors, Interceptors...
> those sorts of things. the GUI and business models are container
> agnostic.

I do agree with this. Indeed, as I stated before, I used to pass the
IKernel to those who needed it.

The MainForm gets the IKernel because it adds to it widgets that
have to be available to plugins (ie. the main menu and the
toolbar).
Obviously, the Domain Model doesn't get any container.

Anyway, I still can't find the error I make that lead to the multiple
instances of ApplicationFacade, even though it is registered as
a singleton in the container.

Any clues?

Thanks again for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to