Design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.
2
votes
0answers
7 views
Replacing ServiceLocator with DependencyInjection when implementing modal dialogs in MVVM WPF application
Hello StackOverflow members,
I am writing my first WPF application and I would like to ask you for help with a problem that I encountered.
I am trying to follow the MVVM pattern and I came to a ...
1
vote
1answer
18 views
How to programically inject a dependency to N classes in Symfony2? Can I somehow inherit injected services?
In my app I am generating n number of classes. They all have the same skeleton and serve a similar purpose. They also share dependencies.
Instead of adding n entries in services.xml like so:
...
0
votes
1answer
7 views
How to inject separate/different parameter for test methods?
I can inject class field like this:
class TestClass{
@Inject
Handler handler;
@Test
public void test1(){....}
@Test
public void test2(){....}
}
But the field "handler" ...
0
votes
0answers
43 views
Pattern to use for different Stages in a software [migrated]
I am developing a software for a laboratory to test some devices. To test each device there are multi subtests which should be done to reach to the final result.To perform a complete test, the ...
0
votes
2answers
35 views
Is that possible to Inject Func<> to an Event
I am using SerialPort_DataReceived event in my project. But I want to have different Strategies of receiving data inside the body of this event.
I have googled and I found that one way is to inject ...
0
votes
1answer
27 views
Dependency Injection in JSR-303 ConstraintValidator
I have the same problem that the guy from this thread has.
More precisely I get the following error, when trying to inject a bean in my custom validator that implements CustomValidator interface ...
1
vote
0answers
27 views
Hook Unity into Web API Filter Attributes
I have Unity running great for all the controllers in my ASP.NET Web API project - just using the default set up that comes out of the NuGet box. I have also managed to hook it up to MVC Filter ...
1
vote
1answer
24 views
PHP, MVC, DI(C), Multiple Databases
I'm using a simple project to help me understand and implement MVC with DI in preparation for unit testing. The site simply will display a different table of data based on the page requested. The ...
1
vote
1answer
11 views
Why I cant Init attribute in Managed Bean constructor
I have a Managed Bean:
public class CategoriaManagedBean {
@EJB
private CategoriaBeanLocal categoriaBean;
private Categoria categoria;
private List<Categoria> menu;
}
In my ...
0
votes
0answers
6 views
Windows store apps and dependency injection
I'm building a Windows 8 app (not RT), and are looking for guidence on how to implement dependency injection in the application, and which container should I use?
Thanks,
Rune
0
votes
1answer
28 views
Testing Spring Controller with @Autowired fields, returns null for fields but gets the controller
Hi I have a controller that I am trying to test, without mocking.
@Controller
public class MyController
{
@Autowired
private Type1 service1;
@Autowired
private Type2 service2;
...
0
votes
0answers
10 views
exported e4 RCP application Dependency Injection
I have an eclipse plug-in developed as an E4Application and runs fine when launched via the 'product' file within eclipse.
However, when exported via the Product Export Wizard, generated exec ...
0
votes
3answers
27 views
Which classes area loaded as bean in Spring ??
I am new to Spring framework.While reading dependency injection i found out two ways to inject beans anotationbased and xml based.
In xmlBased it is quite simple that you define one bean inside your ...
1
vote
0answers
25 views
Ambient Context Where Members Have Dependencies
Hi this is probably just a lack of thought but I can't see how to solve this one "nicely". I have a component responsible for auditing that is used across the system, such:
public class ...
0
votes
2answers
60 views
MVC 3 Exception: Make sure that the controller has a parameterless public constructor
I have MVC 3 app with this same problem. I use Ninject for dependency injection. I cannot trace which controller has a problem, it broke yesterday and I have spent an entire day trying to locate. ...