DI with arguments in the constructor

So I'm implementing a Dependency Injection framework into my Java project (Google Guice) and everything is pretty good, I like it but there's a small problem; I want to make a static instance of my main project's class (where it instantiates the depe

Get an object guice to run with an annotation?

I have a provider: @SuppressWarnings({ "rawtypes", "unchecked" }) @Provides @Singleton @OutboundBroker public EventBroker outboundBrokerProvider() At runtime, I want to get this one. EventBroker outbound=injector.getInstance(Key.get(Ev

Spring MVC @EnableWebMvc Bean config

I´m trying to configure a Bean to be used in a Spring MVC Controller app using the @Bean annotation. As far as I know, the @Bean annotation is equivalent to the tag in XML configuration. What I am doing is the following: The class with the configurat

Name of the design reason: get class level class

Especially in unittests we use this "design pattern" I call "get class from class level" framworktest.py: class FrameWorkHttpClient(object): .... class FrameWorkTestCase(unittest.TestCase): # Subclass can control the class which gets u

Unreferenced loading MVC Ninject dll

I have an MVC4 project in which I am using Ninject as the DI Framework. The problem I am having is trying to split my DI bindings from my implementation as i do not want my main web project to reference all of my other projects. I have tried to creat

The actors of Guice and Akka in Scala

I'd like to reduce the boilerplate needed to bind these akka actors. At current, my code looks like this: bind(classOf[ActorRef]). annotatedWith(Names.named("mines")). toProvider(new TypeLiteral[ActorProvider[MyActor]]() {}). asEagerSingleton()

Roboguice 2.0 injects the application into POJO

I'm newbe in Roboguice, please help. I have an application calss MyApplication in which in onCreate method i initialize some data. Also i have a POJO with buisiness logic which i want to use in my MainActivity (See code snippets below). I need to inj

What is the difference between these two StructureMap config?

We're struggling with understanding the difference between these two ways to configure StructureMap. Our understanding is that they should be identical but we get different results between these two lines inside of Initialize: ObjectFactory.Initializ

ASP.NET MVC Controller Dependency Consolidation (StructureMap)

I'm looking at the controllers in my website, and most of their constructors look like this: public SomeController( IServiceOne serviceOne, IServiceTwo serviceTwo, ILoggingService loggingService, IGeospatialService geoSpatialService) { // copy to cla

PHP - Object Mixing Injection & amp; heritage

This is a follow up question on the following answer : Parent Object in php class A { protected function doSomeStuff(){ echo 'a method that all children will need to call'; } } class B { protected $_parent; public function __construct($parent) { $thi

EF4 Repository Code Test Unit

What's a good approach for writing unit tests for the following GetMyObjectsFiltered(...) method in a EF4 repository: public static class MyRepository { public static List<MyObject> GetMyObjectsFiltered(string searchFilter) { var myQueryableObjects

Injection model in the visual component

I'm using Parsley framework. I'm trying to inject model in custom visual Tree component; private var _model:Model [Bindable] public function get model():Model { return _model; } public function set model(value:Model):void { _model = value; } Build Co

What objects should go in a container of dependencies

Possible Duplicate: What should be injected as C'tor paramter under DI principles ? I looking into using Castle Windsor for my next project and I trying to understand what objects should go into a dependency container. My initial thoughts were if an

MVC 3 beta + Dependency Resolver + Unity = problem obtained

I'm tried to use Dependency Resolver with Unity, and got some problem when my Controller creating. Here example of controller: public class AccountController : Controller { private readonly ICourseService _courseService; public AccountController(ICou

Unity Dependency Injection for WCF Services

Can someone direct me to a good example of Unity Dependency Injection for WCF services? Any blog or msdn article will also help.This answer gives an example on how to enable DI in WCF with Castle Windsor. Just replace the IWindsorContainer with an IU

Startup performance of the dependency injection

I recently was asked to troubleshoot some performance problems in an application built with Microsoft's Composite UI Application block - specifically that it was taking too long to load. This is built around Microsoft's ObjectBuilder dependency injec