All Questions
Tagged with architecture dependency-injection
41 questions
6
votes
5
answers
535
views
Instability metric vs Dependency Injection
Below is an excerpt of Fundamentals of Software Architecture, page 65, which I am reading:
The instability metric determines the volatility of a code base. A
code base that exhibits high degrees of ...
0
votes
1
answer
317
views
Is it ok to Inject a whole object instead of only the dependencies
I'm working with the Dependency Injection Pattern in Unity3D (an engine which uses MonoBehavior, a class that doesn't have a constructor, as the base class for all of its game components), and I ended ...
0
votes
3
answers
351
views
How to choose between these different options for communicating between objects?
I have a few objects that should communicate between each other. I also want to have my code unit tested.
I am questioning how I should handle their communication:
Should I make one instantiate the ...
-1
votes
1
answer
989
views
Android project, clean architecture and modular approach
I have this project with MVVM and clean architecture well implemented but I've decided to split it into modules. Right now I have:
apimodule
apimodule: with the retrofit dependencies
app: with the ...
5
votes
1
answer
2k
views
How to handle the Dependencies between Secondary Actor Adapters in the Hexagonal Architecture
I am applying the principles of Hexagonal Architecture (Ports and Adapters) and one aspect is slightly bothering me. In my opinion, the ports and adapters of the secondary actors should completely be ...
0
votes
1
answer
183
views
Is injecting user input dependency class to menu class appropriate?
I am currently designing classes for the User Interface (UI) of my application. When defining the interface of a class MenuTabSelector I faced a design decision of whether I should inject the user ...
1
vote
2
answers
2k
views
Interface/Contracts in separate assembly?
Say I have BusinessService & domain logic as part of MyProj.MiddleTier csproj which connects to MyProj.DAL DataRepository via interface IDataRepository.
I am using IOC unity container to build my ...
2
votes
2
answers
859
views
3 layer architecture In DI based software
I'm building software with 3 layer architecture and asp.net core , as you know the Dependency Injection is Built Into Asp.net core
As i know the 3 layer architecture diagram is like this:
According ...
1
vote
2
answers
244
views
What is better approach to implement dependency injection using MVVM Architecture?
I need to use DispatchQueue within controller and pass it as dependency. This is what I have tried so far and worked out two solutions. Need to ask what is better and in common use by other developers:...
3
votes
1
answer
262
views
What are the pros and cons of keeping most of an application's state in a single struct?
In my application, I have a few classes. Many of these classes share common state like a reference to the logger for example. For example, both A and B require some common state to get their job done.
...
172
votes
8
answers
85k
views
Criticism and disadvantages of dependency injection
Dependency injection (DI) is a well known and fashionable pattern. Most of engineers know its advantages, like:
Making isolation in unit testing possible/easy
Explicitly defining dependencies of a ...
3
votes
1
answer
419
views
Dependencies between functions-only modules: hardcoding vs alternatives
In switching from a procedural background to "FP in the small, OO in the large" I'm grappling with the following problem. Suppose there're modules, each only containing numerical math functions ...
23
votes
3
answers
12k
views
Is Poor Man's Dependency Injection a good way to introduce testability to a legacy application?
In the past year, I created a new system using Dependency Injection and an IOC container. This taught me a lot about DI!
However, even after learning the concepts and proper patterns, I consider it ...
1
vote
2
answers
158
views
IoC configurations - one file/assembly in solution or one file per executing assembly?
We're wondering what the best practise for registering types in a IoC-Container is.
What would be arguments for and against the following principles:
Principle 1: Only one Assembly my.project....
40
votes
2
answers
10k
views
How much is too much Dependency Injection?
I work in a project that uses (Spring) Dependency Injection for literally everything that is a dependency of a class. We are at a point where the Spring configuration file has grown to about 4000 ...