What is the difference between an IWindsorContainer and an IUnityContainer?

I worked with two types of containers between IWindsorContainer and IUnityContainer in different projects for maintenance and interface binding. However, I'm not quite sure what the differences are? Do they have the same features? If so, then what is the need to develop another in the case of the existing one. Or do they have some differences? If yes, what is it? what purpose will I use, over which? I have a little documentation against this confusion, but I did not shut up. Therefore, if you inform me of this, I will be grateful. Mention that I am using NHibernet mapping NHibernet .

+7
asp.net-mvc entity-framework fluent-nhibernate nhibernate-mapping
source share
2 answers

I used both containers and the huge difference between them, over the years of using each of them, was that UnityContainer is managed by the team and is still expanding. The Windsor container was not very good at returning real errors. UnityContainer has excellent documentation and is very easy to install using nuget or another storage manager.

Here is what I mean ... if you look at how to use your code, https://github.com/castleproject/Windsor/blob/master/docs/README.md , for example, windsor is very dark.

 public void Install(IWindsorContainer container, IConfigurationStore store) { container.Register(Classes.FromThisAssembly() .Where(Component.IsInSameNamespaceAs<King>()) .WithService.DefaultInterfaces() .LifestyleTransient()); } 

If you look at unity, https://github.com/unitycontainer/unity/blob/master/quickstarts/CS/EventBroker/Src/Stoplight/Program.cs , it becomes more clear what happens by registering them differently. Error codes when you lower the rabbit hole are also much cleaner with Unity.

 IUnityContainer container = new UnityContainer() .AddNewExtension<SimpleEventBrokerExtension>() .RegisterType<ILogger, TraceLogger>() .RegisterType<IStoplightTimer, RealTimeTimer>(); 
+3
source share
+1
source share

All Articles