Provide more compact, discoverable fluent API
some people find current fluent API too verbose and hard to discover:
- connect that for method that takes params IRegistration[] you have to use either Component. or AllTypes.
Perhaps a default implementation of IWindsorInstaller that exposes protected methods working with nested closures to be more discoverable, would be a good addition
This will be part of v3. Tangible ideas, preferably in form of runnable proof-of-concept implementations welcome.
4 comments
-
@Alexy
I agree with most of your feedback, and as a matter of fact most of the methods on the IWindsorContainer (and IKernel), all the Add* are obsolete. I didn't deprecated the indexers, but I think I will do it, just for clarity and to have one way of doing things.
Thanks for your feedback!
Let me know of all the other ideas you have. -
Alexey Diyan
commented
@Krzysztof
I'm really really sorry that leave your proposal without any answer.
Actually I did some notes about the main API of Caslte.Windsor in the WindsorContainer class. I also wanted to think about how fluent registration could be looked in order to provide feedback... but every time postpone this until just forgot about it.
In the link below you could check some of my comments. Most of them are obivious. Hope this will be useful.
-
@Alexey
Thanks for your input on this.
I agree that Windsor's API is not very discoverable and it's too verbose. That's why I created this suggestion in the first place.There are some things I like about Autofac's API, but there are some I dislike.
I've had in mind idea you might find similar in some regard to what Autofac is offering. Once I get some time to actually start working on it, I'm gonna create a branch and I'll be looking for feedback.What exactly do you like about Autofac's API as compared to what Windsor provides now?
-
Alexey Diyan
commented
Personally I really like fluent API that Autofac v2 have:
http://code.google.com/p/autofac/wiki/NewInV2
builder.RegisterType<IService>().As<ServiceImpl>.SingleInstance();Compared to Castle.Windsor it much more shorted and easier to read:
container.Register(Component.For<IService>().ImplementedBy<ServiceImpl>().LifeStyle.Transient);I very like Castle.Windsor IoC because it mature, has a lot extension points and very popular.
But unfortunately his fluent API is not quite good, in my opinion.
Anyway, I'm big fan of this IoC and very grateful to all contributors of this project.