.NET IoC Container Comparisons
With so many IoC containers is there a decision matrix to help in narrowing them down based on features, supported platforms, etc.? ...
With so many IoC containers is there a decision matrix to help in narrowing them down based on features, supported platforms, etc.? ...
How can I test if the Session scope is active in Spring? for example, at startup some classes need a User object which is Session scoped, than i return a mock User object. the bean in question is declared with aop:scoped-proxy. how can i test if the session scope is active? ...
I've got a CustomersModule.cs with the following Initialize() method: public void Initialize() { container.RegisterType<ICustomersRepository, CustomersRepository>(new ContainerControlledLifetimeManager()); CustomersPresenter customersPresenter = this.container.Resolve<CustomersPresenter>(); } The class I resolve from the cont...
In this stackoverflow question I learned that Prism/Unity is not as decoupled as I thought, e.g. if I have this class which gets menuManager injected into its constructor, then I have to make sure that this class actually exists somewhere (I thought that you could just pull the .dll that contains the class and the container would deal wi...
I've taken the plunge and used Guice for my latest project. Overall impressions are good, but I've hit an issue that I can't quite get my head around. Background: It's a Java6 application that accepts commands over a network, parses those commands, and then uses them to modify some internal data structures. It's a simulator for some har...
Hello, I'm designing medium-size website using asp.net mvc technology. All business logic is organized into IServices (like IDomainService, IUserService, IAuthService, ITrainingService). All services are using IRepositories. I'm using Ninject 1.5 to wire services with controllers and it seems working perfectly. There is so far one subj...
I was just starting to get comfortable with MVC when somebody mentioned IoC containers to me, and now I feel like I've fallen a few thousand feet and need to climb back up again. I was tempted to just ignore them, but then I read up on the Component Lifestyle. This seems like a big deal to me, as explained, uncommited changes to databa...
I would like to log when a component (interface and implementation) is registered to my container. What is the best way of doing this? I found the IKernelEvents interface that looks promising but I can't find how to actually use it. ...
Hello, I have common DI configuration for my application and integration tests. However, a couple of the dependencies do differ; e.g. my IEMailGateway in the integration tests uses a decorated version so that 'real' e-mails are not sent. In Windsor I would have the 'main' configuration xml file and simply add an include to add the var...
I've been using the Spring.Net IoC container and can use it to inject properties that are of type IList and even IList<T> but I'm a bit stumped as to how to inject a property thats of type string[]. There doesn't seem to be an <array> element defined in the XSD's and using <list> <value> </list> doesn't work either. If anyone could pos...
Hi, I have a BaseController that I'm using to house my cross cutting concerns for an MVC project. However, this means that my Controller has 3 dependencies: public BaseController (IUserService u, ITenantDetailsService t, ISiteConfiguration c) The side effect of this is that my constructors for each derived controller are awash with...
Jimmy Bogart has an article on using Automapper with an IoC container. He has an example using StructureMap but I am using Unity and I'm not sure how to use an InjectionConstructor properly. Below is the code from the Article and below that is my poor attempt. Can anyone tell me how to do this properly? public class ConfigurationRegis...
In dynamic languages such as Ruby and Python, the concept of a formal IOC pattern with a traditional (for us static guys) interface-driven implementation doesn't exist. Will C#'s upcoming Dynamic type cause or at least enable the need for static IOC patterns to be eliminated? That MS's P&P Unity project takes 231 pages of documentation ...
On this AutoFac "Best Practices" page (http://code.google.com/p/autofac/wiki/BestPractices), they say: Don't Pass the Container Around Giving components access to the container, or storing it in a public static property, or making functions like Resolve() available on a global 'IoC' class defeats the purpose of using dependency injectio...
I am trying to use Spring and wx-xmlrpc together. The problem is that XmlRpcClient has a setConfig() method that doesnt follow the Java Bean spec : the setter and the getter dont use the same Class. So Spring complaints when I have the following context.xml : <bean id="xmlRpcClient" class="org.apache.xmlrpc.client.XmlRpcClient"> <pr...
I'm trying to set up Ninject for the first time. I've got an IRepository interface, and a Repository implementation. I'm using ASP.NET MVC, and I'm trying to inject the implementation like so: public class HomeController : Controller { [Inject] public IRepository<BlogPost> _repo { get; set; } public ActionResult Index() {...
Could anyone recommend some good resources for getting started with the Unity framework? I've downloaded the source from Codeplex and got it to compile. So now I've got a set of compiled binaries, where do I go next? I understand the principles of inversion of control but don't have much knowledge of the specifics of the Unity framework....
Posted this on the structuremap group as well. We just started using structuremap last week, and are really digging it. I'm sure I'm missing something simple. I am trying to mimic the following code, using SM within my factory. I'm ok with having the container dependency in the factory class. The consensus in this thread seemed ...
Should I have any concerns about using a IoC/DI Container, specifically ninject, in a windows mobile app using the compact framework 3.5? ...
In this Autofac IoC article they show an example of mapping an interface to an implementation with a parameter. You'll find it halfway down the article. What is the Unity equivalent in XML? Can't use the fluent syntax for what I'm doing. Needs to be an external config file. UPDATE: This is the specific piece of code I want to know how ...