Unity interception behind the scenes
I wonder how Unity interception works behind the scenes? I mean interface,transparent proxy and virtual method proxy interceptors implementation. Anyone could shed some light on this? ...
I wonder how Unity interception works behind the scenes? I mean interface,transparent proxy and virtual method proxy interceptors implementation. Anyone could shed some light on this? ...
In simple terms and/or in high-level pseudo-code, how does a DI container work and how is it used? ...
I'm using Ninject to do some dependancy injection. (Mainly for the DAL), my project consists of 3 aspects and are as follows, Project.Lib (Everything database, services and anythign else that is logic) Project.Admin (Administration) Project.Web (Front end what the user see's) Now, each of my controllers within my projects inherit fro...
Hello, I have a MessageSender class that its constructor looks like this: public MessageSender(IInputComponent input, IOutputComponent output) { m_Input = input; m_Output = output; } This is how I instantiate it: Container.RegisterType<IMessageSender, MessageSender>(); Container.RegisterType<IInpu...
We are debating to correct way to setup a notification service. This serivce will be called by various apps and the service will need to return relevant data back. My feeling is you just create a Web service that the intranet portal (or anything) could access by sending the user ID and in return getting any information (User 425 report ...
Hi, I'm looking for an IoC container to use in my Compact Framework application. Trying out Funq I noticed that I can't find a way to do Property Injection with it. I've looked through the discussion on the project's site and the unit tests for it, but I can't find any example of Property Injection. Does Funq support Property Injecti...
I was having a heated debate with one of my colleagues on dependency injection, and realized I didn't quite know all the facts on the subject. So, take this code (just so you know,we're using Castle Windsor) IPlayerService service = Container.Resolve<IPlayerService>(); The above code is obviously an example of DI using an IoC. Howev...
Hello all, Consider this abstract class public abstract class Foo { public Injectable Prop {get;set;} } i have an application that i want to enhance and simultaneously refactor for simplicity. I have over 100 classes that call some same stuff (e.g Class Injectable) and i am thinking that this behaviour can be abstracted and set t...
Hi, I have a problem which seems very similar to the one described in http://markmail.org/message/6rlrzkgyx3pspmnf which is about the singleton actually creating more than a single instance if you're accessing it using different service types. I'm using the latest release of Ninject 2 for Compact Framework and the exact issue I'm havin...
I'm writing an IoC container for my own learning/growth. Normally I would write something like the following: using(DisposableObject dispObj = new DisposableObject()) { UserRepository users = new UserRepository(dispObj); // Do stuff with user. } Would turn to: using(IDisposableObject dispObj = Container.Resolve<IDisposableOb...
I have 3 classes: A, B, and C All of these classes implement an interface IMyInterface I would like the interface to be defined like so: internal IMyInterface<E> where E: class { E returnData(); } So that it can return data of type E. The type "E" will be a POCO object created with the Entity Framework v4. In a separate class I...
After reading more and more about IoC containers, I read this post about not having IoC.Resolve() etc in your code. I'm really curious to know then, how can I remove the dependency on the container? I'll want to write code like the following: public void Action() { using(IDataContext dc = IoC.Resolve<IDataContext>()) { ...
I have several classes that implement the same interface. interface IBidManager<E> where E : IEntity public class BidManager : IBidManager<EntityObject1> public class BidManager2 : IBidManager<EntityObject2> public class BidManager3 : IBidManager<EntityObject3> In my business manager class I have: public class BusinessManager : Mana...
I am wiring my UserService type classes using spring's IOC. But what about my User class? I have a interface User, then a UserImpl class. In my controller action's do I just do: User u = new UserImpl(); Or would it sometimes make sense to use IOC for this also? Sometimes I use a different constructor also when instantiating a cla...
Hi, I'm having a problem with a component in my container with a Transient lifestyle. The first time I call resolve, I hit the constructor of the implementation type as expected. However, the second time I call resolve, a new instance is not constructed. Rather, the existing instance is reused. I don't think this should happen, since ...
I wrote my CustomLifetimeManager like this: public class CustomLifetimeManager <T> : LifetimeManager { private readonly string _arg; public CustomLifetimeManager(string arg) { _arg = arg; } } Now, it works easy configuring the container programmatically, but how add it in configuration file like the following? ...
I've been working on creating my own IoC container for learning purposes. After asking a couple questions about them, I was shown that creating a factory to "resolve" the objects was the best solution (see third solution here). User Krzysztof Koźmic showed that Castle Windsor actually can implement this for you. I've been reading the so...
I'm in the process of developing an ASP.NET MVC project, and after several weeks of research, I have a pretty good framework in place using StructureMap to register my dependencies at bootstrap time, create my controllers with the correct implementations, a custom model binder for passing data to my controller, etc. After thinking about...
I'm getting the feeling that there's is not such thing as inversion of control or rather the correct term is dependency injection. Am I wrong to assume this? I've been trying to define IoC for my own sake. In doing so I've learned a great deal about IoC containers and dependency injection. Just now, I read this from Martin Fowler's web...
I use ektorp to connect to CouchDB. The way to build an ektorp HttpClient instance is to use builder pattern: HttpClient httpClient = new StdHttpClient.Builder() .host("mychouchdbhost") .port(4455) .build(); I am relatively new to Spring. P...