I've always been using facilities to register my components but noticed the IWindsorInstaller.
It both look similar to me and I would like to know what the difference is between both and which one should be used where.
Dan,
the difference is the following:
Configuration
class, or FromAssembly
class that you can use to either use configuration file, or to autodiscover your installers and run them all in one go because in most apps you will have several of them.TypedFactoryFacility
which adds ability to auto create factories to transparently pull components from the container. You have StartableFacility
which allows components to be started/stopped without you having to explicitly worry about it. You also have integration facilities for things like NHibernate, or WCF, or Monorail, or ASP.NET MVC that make Windsor aware of certain aspects of other frameworks it works with so that your work is easier. In terms of capabilities facilities can have their own configuration. There also is no helpers to batch add facilities as in most apps you'll only need a few.Both of them can register stuff, but the main difference is - installers register whatever your application needs (including adding facilities). Facilities on the other hand register what they need in order to do their job.
That usually means that facilities register extensions to the container like custom resolvers, ComponentModel construction contributors or interceptors - things which by definition are aware of the container.
Installers register application level components which best have no knowledge of the container at all.
Hope that makes the distinction clearer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With