UPDATE
As I've tried to get MEF working throughout my application, I'm coming across more an more places where I just don't get why it's not automatically creating my library when I expect it to. I think it all comes back to what Reed was saying about needing MEF to create everything. So right now, I have an XML reader class that need...
Hi,
Anyone know if there exists any IoC container that can handle this:
Given:
ISomeInterfce<T> where T : Entity
Impl1 : ISomeInterfce<Entity1>
Impl2 : ISomeInterfce<Entity1>
Impl3 : ISomeInterfce<Entity2>
Impl4 : ISomeInterfce<Entity2>
I want to be able to auto wire my system and be able to resolve like this
IoC.ResolveAll(typ...
How should the configuration for an IoC container be organized? I know that registering by code should be placed at the highest level in an application, but what if an application had hundreds of dependencies that need to be registered? Same with XML configurations. I know that you can split up the XML configurations into multiple fil...
This is sort of a continuation of one of my earlier posts, which involves the resolving of modules in my WPF application. This question is specifically related to the effect of interdependencies of modules and the method of constructing those modules (i.e. via MEF or through new) on MEF's ability to resolve relationships.
First of all,...
I've had a few questions about MEF recently, but here's the big one -- is it really all-or-nothing, as it appears to be?
My basic application structure is simply an app, several shared libraries that are intended to be singletons, and several different plugins (which may implement different interfaces). The app loads the plugins, and b...
I have an interesting situation where I need to do something like this:
[Export[typeof(ICandy1)]
[Export[typeof(ICandy2)]
public class Candy : ICandy2 { ... }
where
public interface ICandy1 { ... }
public interface ICandy2 : ICandy1 { ... }
I couldn't find any posts anywhere regarding using multiple [Export] attributes, so I figur...
I'm Java beginner and IoC as well. How to do stuff:
public class Foo{
//private Bar bar; //Bar is an interface
private int var;
public Foo(){
}
public void setVar(int var){
this.var = var;}
public Bar getBar(){
if(var==1){
return new BarImpl1(); //an implemantation of Bar interface
}
else if(var==2){
return new BarImpl2(); //an imp...
This seems to be a big gap in it's spring integration. Has anybody done this or has successfully integrated Spring and Oval successfully?
...
How do I wire up dependencies where the dependency is in the form of a collection ??
For Example:
public class Ninja {
public List<IShuriken> Shurikens {get;set;}
public IKatana Katana {get;set;}
public void Attack()
{
// some code goes here to use weapons and kill people
}
}
How do i use a container like Ninject in a case like t...
I primarily use NInject as my IoC container, and is very happy with it - don't want to change that. But some things I want to import using MEF. The thing is, I want the imports to created by the IoC container as the imports can have dependencies to things that I've registered in the NInject IoC.
So, my question is: can I import the type...
Hi everybody!
Currently, we use programming registration of WCF proxies in Windsor container using WCF Integration Facility. For example:
container.Register(
Component.For<CalculatorSoap>()
.Named("calculatorSoap")
.LifeStyle.Transient
.ActAs(new DefaultClientModel
{
Endpoint = WcfEndpoint.FromConfig...
Hi,
Q1 If I have a reusable library that is available, that uses interfaces with classes that use the getInstance concept to create concrete classes for you to use, then in this case would that make sense on the client side to use the IOC container to create instances of these classes? Or is that really applying a double layer of abst...
I have a custom implementation of IResourceProvider and ResourceProviderFactory. Now the default way of making sure ASP.NET uses these custom types is to use the web.config and specify the factory like so:
<globalization resourceProviderFactoryType="Product.Globalization.TranslationResourceProviderFactory" />
This works perfectly, exc...
Hi, is there a way using the Unity framework to pass an integer as an argument into the constructor or a resolved object?
Pseudo code..
IService svc = Container.Resolve<ConcreteService>()
in this case Concrete service will be something like this...
public class ConcreteService
{
public ConcreteService(int val)
{
}
}
Al...
Continuing on my quest for a good plugin implementation I have been testing the StructureMap assembly scanning features.
All plugins will inherit from abstract class PluginBase. This will provide access to common application services such as logging. Depending on it's function, each plugin may then implement additional interfaces, for e...
Hello,
I was wondering how I could bind the IPrincipal to HttpContext.Current.User in Asp.net Mvc with Ninject.
Friendly greetings,
Pickels
Edit:
Not sure if it matters but I use my own CustomPrincipal class.
...
Hi,
I want to assert that my registrations are valid, i.e no dependency is missing and there are no circular dependencies.
I'd like to do that in my application (and not in a unit-test) so I'd be able to fail-fast if the configuration is invalid.
I also want to accomplish that without resolving (and instantiating) all the components - on...
Hello, Guys.
I'm developing a application using MVP and I have a question about How inject my dependencis in my presenters class. Because my presente receve too an instance of the my view. I thought of create a viewbase and inside it I create my dependencies instances and inject it in my presenter instance. Could also have a HttpModule ...
Hi,
Has anyone been able to get AutofacControllerFactory working in applications where the controllers are split into Areas?
Looks like it is not supported out of the box in the current version.
Thanks
...
Lets consider some cases:
_windsor.Register(Component.For<IProductServices>().ImplementedBy<ProductServices>().Interceptors(typeof(SomeInterceptorType));
In this case, when I ask for a IProductServices windsor will proxy the interface to intercept the interface method calls.
If instead I do this :
_windsor.Register(Component.For<Pr...