All Questions
6 questions
0
votes
3
answers
662
views
Java Library - How to do Pure Dependency Injection When State is a Factor?
To set the stage, I am trying to do pure dependency injection for a Java Library I am creating to make it more testable. As it is a library, I want to do pure dependency injection without creating a ...
1
vote
2
answers
473
views
Chain of responsibility or simple dependency injection for Querying API
I am working on refactoring a project code that is wired up in a tangled way. It was started with decent dependency injection and over time with all custom requirements it looks it got tangled up. ...
-1
votes
1
answer
800
views
IOC principle - Servlet container implementation
IOC principle can be implemented, using either:
Dependency Injection
Service locator pattern
This article also supports these two approaches for implementing IOC principle.
Spring IOC container is ...
27
votes
4
answers
10k
views
Legitimate "real work" in a constructor?
I am working on a design, but keep hitting a roadblock. I have a particular class (ModelDef) that is essentially the owner of a complex node tree built by parsing an XML schema (think DOM). I want to ...
5
votes
2
answers
1k
views
How to decouple simple factory and default implementation?
I have a simple factory class (FileResources) with static factory methods providing a default implementation (DefaultFileResource).
public final class FileResources {
private FileResources() {}
...
11
votes
4
answers
19k
views
How to use Dependency Injection in conjunction with the Factory pattern
Consider a module that is responsible for parsing files of any given type. I am thinking of using the strategy pattern to tackle this problem as I have already explained over here. Please refer to the ...