Hacker News new | ask | show | jobs
by tkellogg 4886 days ago
Maybe you should be using C#. As a community we fight hard to reject xml configuration, favoring type safe lambda expressions instead. Anything that ignores the type safe guarantees that C# offers quickly does. There was briefly a spring.net but it quickly died for this reason.
1 comments

Agreed. Is the author's problem with IoC or with XML config? hard to tell, but they're really not the same thing.

IoC containers in C# have rejected config in XML, in favour of config in code, using either generics and lambdas (e.g. register Component.For<IFoo>.ImplementedBy<Bar> ) or via scanning (e.g. AllTypes.FromAssembly(x).BasedOn<Foo>().WithService.FirstInterface() ).

Spring.net was an exception and in comparison it really sucked.

IoC Config in code is much better. But can't this be done in java too?

That's what Guice does, and newer versions of Spring too (though I'm not sure if you can go full Java and drop the XML entirely).