Skip to main content

Questions tagged [dependency-injection]

Design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.

1 vote
0 answers
81 views

Dependency Injection helper fluent UI

I am coding a NuGet package heavily inspired by Scrutor. I wanted to simplify Scrutor's fluent interface and improve its attribute-based class registration. Thus, I'd like to gather some opinions and ...
Manuel Fernandez's user avatar
1 vote
1 answer
61 views

Databases, dependency injection and static methods

I'm working on a Next.js app and looking at the best way to structure database access. With Next.js and web based apps in general, there are lots of different "server actions", aka, API ...
Will Calderwood's user avatar
4 votes
2 answers
136 views

Choosing between field injections and constructor injections for modular Java applications with Spring Boot

I'm six months into a Java training program and have developed a Spring Boot application, adhering to Java's separation of concerns principle. I've organized my application with distinct sections for ...
Kerem Tazedal's user avatar
2 votes
2 answers
256 views

How can I design the configuration of the library with Typed HttpClients in DI better?

I have written a .Net Client wrapper for Google Gemini (Generative AI) REST API and published it as a Nuget package. I am seeking a review of the code. I have spent quite some time in designing how it ...
Junaid's user avatar
  • 137
1 vote
0 answers
77 views

C# like Dependency injection for C++ on embedded device

I was wondering if it would be possible to create a C# like syntax for dependency injection. My device is running constantly and acting more or less like a service. I came up with the following. My ...
Bas Visscher's user avatar
0 votes
1 answer
119 views

A practice program to manipulate a database table using dependency injection [closed]

I am learning dependency injection and trying to use this pattern on practice. I am trying to write simple program where the user can write something to database, delete row and clear all rows from db....
Денис Шпак's user avatar
2 votes
1 answer
164 views

Saving entity containing complex jsonb column with validation and comparision

I've been a .NET Developer for almost 4 years. I'm stronly learning and trying using design patterns and following SOLID principles for 3 months right now (I know - a little late, but better late ...
KJanek's user avatar
  • 143
2 votes
1 answer
363 views

An NVIDIA Jetson Nano GPIO Wheel Encoder Message Publisher using ROS2

Although this code uses ros2 my concern is about C++ code quality, because I still struggle when it comes to making good design ...
Sam Hammamy's user avatar
4 votes
2 answers
260 views

Automating the process of determining which boxes to load on each flight for freight company

I was given a test assignment for the interview of the company and below is the code that I shared with them. I developed it using .NET 6 (Core) Console application. Actual problem statement: Coding ...
user19031158's user avatar
2 votes
1 answer
282 views

API call to list top stories using dependency injection in iOS with MVVM

I'm currently trying to find out what's the best networking architecture for MVVM applications. I couldn't find many resources and decided to go with dependency injection based architecture as per the ...
Tharindu Ketipearachchi's user avatar
4 votes
0 answers
108 views

Determine when a file is no longer being changed by hashing

I have a requirement to essentially scan a filesystem on any kind of filesystem and move a resource whenever it is ready. To do this I have the following code ...
Patrick Christie's user avatar
2 votes
0 answers
200 views

Android architecture and dependency injection of domain layer usecases

I am implementing some of the architectural designs from Google I/O's app to my own app, but I have come across something in their app that has created some confusion for me. They have a domain layer ...
CJR's user avatar
  • 151
3 votes
0 answers
225 views

Simple Java IoC container for dependency injection

I have come up with a quick and simple IoC container to enable minimal dependency injection support in one of my Java projects. The container supports services with: A transient lifetime, meaning, a ...
Amal K's user avatar
  • 173
4 votes
0 answers
139 views

Injectable EventLogger for custom application events that are handled differently from normal logs

I am trying to become better at designing classes for dependency injection and IOC in general. It is often not an intuitive concept. I have the following python interface and implementation for a ...
Patrick Christie's user avatar
0 votes
0 answers
792 views

Hangfire context constructor injection

I tried following IHttpContextAccessor pattern but for Hangfire context. What I'm mostly interested in is CustomScope class with Resolve method. I'm using ActivatorUtilities there because otherwise I ...
Medo's user avatar
  • 109

15 30 50 per page
1
2 3 4 5
18