Skip to main content
Code Review

Questions tagged [dependency-injection]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
75 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 ...
1 vote
1 answer
52 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 ...
4 votes
2 answers
131 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 ...
2 votes
2 answers
251 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 ...
1 vote
0 answers
73 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 ...
0 votes
1 answer
111 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....
2 votes
1 answer
162 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 ...
2 votes
1 answer
357 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 ...
4 votes
2 answers
250 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 ...
2 votes
1 answer
278 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 ...
4 votes
0 answers
103 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 ...
2 votes
0 answers
196 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 ...
3 votes
0 answers
221 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 ...
4 votes
0 answers
136 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 ...
0 votes
0 answers
789 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 ...

15 30 50 per page
1
2 3 4 5
...
18

AltStyle によって変換されたページ (->オリジナル) /