Idea to make IWindsorInstaller more useful

Visto 97 veces
Saltar al primer mensaje no leído

Gian Marco Gherardi

no leída,
22 mar 2010, 17:14:5322/3/10
a castle-pro...@googlegroups.com
To make complex component registration i often use a class that inplements IWindsorInstaller.
However this can cause monolithic compilations, for example:
  • App.exe
    • References
      • CustomInstaller.dll
    • class Program
      • Ioc = new WindsorContainer();
      • Ioc.Install(new CustomInstaller());
  • CustomInstaller.dll
    • References
      • ExternalLib.dll
    • class CustomInstaller : IWindsorInstaller
The monolitic compilation is caused by:
App.exe =depends on=> CustomInstaller.dll =depends on=> ExternalLib.dll

To break monolithic compilation i do the following trick
  • App.config
    • <component id="installer" service="Castle.Windsor.IWindsorInstaller, Castle.Windsor" type="CustomInstaller.CustomInstaller, CustomInstaller" />
  • class Program
    • Ioc = new WindsorContainer(new XmlInterpreter());
    • Ioc.Install(Ioc.ResolveAll<IWindsorInstaller>());
It would be nice to have this trick done automatically by WindsorContainer


--
Gian Marco Gherardi

Krzysztof Koźmic

no leída,
22 mar 2010, 17:27:4722/3/10
a Castle Project Development List
http://castle.uservoice.com/forums/38955-windsor-v3/suggestions/540047-expose-iwindsorinstallers-via-xml-config?ref=title

On Mar 22, 10:14 pm, Gian Marco Gherardi


<gianmarco.ghera...@gmail.com> wrote:
>  To make complex component registration i often use a class that inplements
> IWindsorInstaller.
> However this can cause monolithic compilations, for example:
>

>    - App.exe
>       - References
>          - CustomInstaller.dll
>       - class Program
>          - Ioc = new WindsorContainer();
>          - Ioc.Install(new CustomInstaller());
>       - CustomInstaller.dll
>       - References
>          - ExternalLib.dll
>       - class CustomInstaller : IWindsorInstaller


>
> The monolitic compilation is caused by:
> App.exe =depends on=> CustomInstaller.dll =depends on=> ExternalLib.dll
>
> To break monolithic compilation i do the following trick
>

>    - App.config
>       - <component id="installer" service="Castle.Windsor.IWindsorInstaller,


>       Castle.Windsor" type="CustomInstaller.CustomInstaller, CustomInstaller" />

>    - class Program
>       - Ioc = new WindsorContainer(new XmlInterpreter());
>       - Ioc.Install(Ioc.ResolveAll<IWindsorInstaller>());

SimoneB

no leída,
23 mar 2010, 16:57:5923/3/10
a Castle Project Development List
Gianmarco, don't you still have to reference the project containing
the installer if you want its assembly in your app execution folder so
that windsor can pick it up?

On Mar 22, 10:14 pm, Gian Marco Gherardi
<gianmarco.ghera...@gmail.com> wrote:

>  To make complex component registration i often use a class that inplements
> IWindsorInstaller.
> However this can cause monolithic compilations, for example:
>

>    - App.exe
>       - References
>          - CustomInstaller.dll
>       - class Program
>          - Ioc = new WindsorContainer();
>          - Ioc.Install(new CustomInstaller());
>       - CustomInstaller.dll
>       - References
>          - ExternalLib.dll

>       - class CustomInstaller : IWindsorInstaller


>
> The monolitic compilation is caused by:
> App.exe =depends on=> CustomInstaller.dll =depends on=> ExternalLib.dll
>
> To break monolithic compilation i do the following trick
>

>    - App.config
>       - <component id="installer" service="Castle.Windsor.IWindsorInstaller,


>       Castle.Windsor" type="CustomInstaller.CustomInstaller, CustomInstaller" />

>    - class Program
>       - Ioc = new WindsorContainer(new XmlInterpreter());
>       - Ioc.Install(Ioc.ResolveAll<IWindsorInstaller>());

Gian Marco Gherardi

no leída,
27 may 2010, 8:32:0627/5/10
a castle-pro...@googlegroups.com
Referencing project is just a way to accomplish that.
You can also use post build event or your build process can choose how to configure the application by dynamically select the assembly that contain IWindsorInstaller.

With the proposed feature all that solutions are viable.

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.




--
Gian Marco Gherardi
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos