1
vote
2answers
131 views

Initialization of objects in a system using dependency injection

This is a follow up question to the following post: Injecting dependencies (DI) in c++ applications In a system that uses DI, someone, somewhere should be responsible to create the various objects ...
2
votes
2answers
193 views

Injecting dependencies (DI) in c++ applications

I am playing with dependency injection, but i am not sure I am doing it right. Especially, I am not sure what should be the correct way to build classes with injected dependencies. Say I have a class ...
1
vote
3answers
167 views

Should I consider loosely-coupling for class methods as well? [duplicate]

I'm a fan of Dependency Injection, however I don't know how much both public and private methods inside a class should be loosely-coupled. Just to picture it better, when I have both projectId and ...
0
votes
2answers
487 views

Can Dependency Injection used as an alternative to Reflection for creating instances

There is a piece of .net C# code which use Reflection to create an instance using Activator.CreateInstance(). This is an old piece of code and runs on the top of Enterprise Library. Is it a better ...
0
votes
1answer
194 views

Architecting Domain Layer and other modules with dependency injection in mind

I am currently new to Dependency Injection pattern. I am influenced by link by Mark Seemann. I have a confusion regarding whether an interface for an agent class of some agent module should be ...
30
votes
6answers
5k views

Should I use Dependency Injection or static factories?

When designing a system I am often faced with the problem of having a bunch of modules (logging, database acces, etc) being used by the other modules. The question is, how do I go about providing ...
4
votes
1answer
664 views

Explanation of Object-parameter-coupling as mentioned in Code Complete book

I have been reading up on the seminal and excellent book Code Complete. It discusses about the various kinds of couplings that can happen between modules(which may be classes as well as methods): ...
2
votes
2answers
312 views

Desktop application, dependency injection

I am thinking of applying a real dependency injection library to my toy C#/GTK# desktop application. I chose NInject, but I think this is irrelevant to my question. There is a database object, a main ...
3
votes
4answers
312 views

Representing complex object dependencies

I have several classes with a reasonably complex (but acyclic) dependency graph. All the dependencies are of the form: class X instance contains an attribute of class Y. All such attributes are set ...
4
votes
6answers
701 views

How to do dependency Injection and conditional object creation based on type?

I have a service endpoint initialized using DI. It is of the following style. This end point is used across the app. public class CustomerService : ICustomerService { private IValidationService ...
6
votes
2answers
391 views

How to use DI and DI containers

I am building a small PHP mvc framework (yes, yet another one), mostly for learning purposes, and I am trying to do it the right way, so I'd like to use a DI container, but I am not asking which one ...
2
votes
1answer
279 views

Customizing configuration with Dependency Injection

I'm designing a small application infrastructure library, aiming to simplify development of ASP.NET MVC based applications. Main goal is to enforce convention over configuration. Hovewer, I still ...
6
votes
3answers
405 views

Recommendations on integrating DI/IoC container into an existing application

I am now faced with integrating an inversion of control (IoC) container into an existing application, and I'm looking for some recommendations on how that can most easily be accomplished with the ...