Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
63 views

I'm working with InversifyJS and I'm confused about when to use toFactory() and return a promise vs. toProvider(). The documentation doesn't clearly explain the behavioral differences. In my codebase, ...
Sebastian Retzius's user avatar
0 votes
1 answer
85 views

My company has a large codebase. I want to make a class User unittestable with minimal changes by mocking a the MyProvider instance, which is used a lot. But it has a constructor and implements a base ...
MrFox's user avatar
  • 5,184
2 votes
1 answer
64 views

I'm using a modular ServiceStack application (with the HostingStartup attribute), so I'm registering dependencies in the ASP.NET Core built-in IoC container. In Program.cs, I'm also calling the ...
paolo terruccio's user avatar
4 votes
2 answers
170 views

There is a service IFoo from an external library, which has its own mechanisms for registering its components. I need to register the service in the Dry IoC container, along with its additional ...
Maksim Lavrentev's user avatar
0 votes
0 answers
127 views

I refer to MEF 1 the MEF implementation for .NET Framework. The reason I want to use it is because our .NET Framework code base already uses it. It is far from perfect or even optimal, but it is what ...
mark's user avatar
  • 63.6k
1 vote
2 answers
137 views

I have 2 classes, A and B, B depends on A. This is class A package com.pm.spring; public class A { public A() { System.out.println("Default Constructor in A"); } } ...
Pravesh's user avatar
  • 19
1 vote
0 answers
41 views

I’ll illustrate the issue with a simple Web application. The application code is available in GitHub. This application handles two requests: POST /sockets/{id}/subscribe — subscribes to a socket with ...
yaskovdev's user avatar
  • 1,354
0 votes
1 answer
47 views

Say I have a component: export class Component { constructor(@injectable(IDependency) dep: IDependency) {} // other methods/properties do not matter } and the dependency it requires is defined ...
Eugene Strizhok's user avatar
1 vote
1 answer
112 views

I have a service that is tightly coupled with the currently authenticated user. It should receive a userId from a higher context (Controller) as an argument in one way or another. The service cannot ...
chumakoff's user avatar
  • 7,084
0 votes
2 answers
54 views

I have a spring webapp. Here's a simple structure to explain my problem java/ └── com/ └── example/ ├── controller/ │ └── MyController.java // REST Controller ├── ...
YetAnotherBot's user avatar
1 vote
0 answers
155 views

I'm trying to come up with a scalable solution for factory registration in Dart/Flutter using injectable (or any other DI library). Currently, I explicitly create a factory class (BarFactory) for each ...
Tar's user avatar
  • 9,125
9 votes
1 answer
4k views

I'm developing a backend service using FastAPI, and I'm facing issues with dependency injection when trying to perform data processing during the application's startup. Here's a simplified version of ...
OOD Waterball's user avatar
-1 votes
2 answers
382 views

I have several modules in my Spring Boot application (broken with DDD in mind), which would sometimes need to depend on another module not because of logic, but because the entities are related. For ...
Sajad Rezvani's user avatar
1 vote
2 answers
995 views

I recently decided to play a little bit with spring's Bean injection. I have tried to provoke my app to fail when there were two, same type, Bean definition but application started to run. I come up ...
question maker's user avatar
1 vote
0 answers
88 views

does NitroJS (server of NuxtJS) support dependency injection as the following ? call any dependency from the class constructor "dependency injection: inversion of control (IoC)" and let the ...
Abdallah Zaghloul's user avatar
0 votes
1 answer
45 views

I'm working on a .NET project and adding a Dictionary<string, > to the container. Using the statement below works fine. However, I need to initially add a few classes to this dictionary and then ...
Bushra Saifi's user avatar
0 votes
1 answer
288 views

I want to use custom express route in inversify with express+typescript So code is below: App.ts import 'reflect-metadata'; import { InversifyExpressServer } from 'inversify-express-utils'; import { ...
Pankaj jha's user avatar
0 votes
1 answer
150 views

inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control from a generic framework. The framework can be Java Spring ...
Aleksander Chelpski's user avatar
1 vote
2 answers
133 views

I have a WPF application. In the main window on the left is a listbox with several entries, and on the right is a ContentControl into which, when selecting one of the entries, the UserControl along ...
The Witcher's user avatar
2 votes
2 answers
877 views

I need an equivalent to dependeny injection to resolve Blazor/Razor components. That is, I want to decouple my components in Razor Class Libraries in the exact same way that DI / IoC allows us to ...
user3386507's user avatar
1 vote
1 answer
83 views

I'm using Autofac for dependency injection in my .NET application. I have a scenario where I want to register a service as a singleton and its dependency as InstancePerDependency. Here's a simplified ...
Yoav M's user avatar
  • 13
0 votes
1 answer
63 views

(I use logging as an example here, but it could be any type.) I have a multiple components that would like to write to the same log file. I know that I can resolve ILoggerFactory and get the same ...
John V's user avatar
  • 1,393
1 vote
2 answers
442 views

I am new to IOC containers and i am trying to understand how to use them. I understand the concept but I having issues on how to practically apply it. Currently, I am using Unity ioc container to ...
Jean's user avatar
  • 47
0 votes
1 answer
1k views

Hi there, I get this error When I tried to start my main springboot class. *************************** APPLICATION FAILED TO START *************************** Description: Field deptMapper in com....
lilpiggie0522's user avatar
0 votes
1 answer
85 views

Consider the following situation: A MVVM desktop GUI application where the user can create/edit a "project". Think of a project like the Visual Studio solution: It's a file (currently an XML ...
titanicsnake's user avatar
-1 votes
2 answers
179 views

I am new to the spring boot and Bean concept. My Classes are as follow: public class PersonController { private final AuditService<Person> auditService; @GetMapping("/{id}/revisions&...
Maryam Koulaei's user avatar
0 votes
0 answers
81 views

I am trying to implement SQLite with IOC DI in a WinUI 3 app. I have created a minimal github project that demonstrates the issue. The UI freezes & is intermittant, it can take a while to ...
tinmac's user avatar
  • 2,602
1 vote
1 answer
2k views

I have a pretty basic .NET 6 app which only goal is to receive messages from Azure Service Bus and handle them. When my app works, I am pretty happy with the result and it is answering the business ...
Dodge's user avatar
  • 41
0 votes
1 answer
305 views

When I try to pass the argument to parent class via super class in inversify there is argument error : "message": "The number of constructor arguments in the derived class Child must ...
Mr X's user avatar
  • 1,759
0 votes
0 answers
42 views

Dirs tree is as follow:enter image description here I coding a statemachine with stateless4j in CTU.java of ConditionTest module, this module is used to store types.And create a springboot demo called ...
DC_pig's user avatar
  • 11
1 vote
6 answers
953 views

I am trying to understand the Strategy Pattern in order to utilise it for a problem I have. The current code looks as such where I have an amount that I want to process based on a payment type. public ...
tase akpo's user avatar
0 votes
1 answer
52 views

Spring documentation describes that beans managed by Ioc container are implicitly pre-instantiated by default other than specifying them as being lazy-initialized. I define a child bean definition A ...
Ford Chen's user avatar
1 vote
1 answer
4k views

I'm a total beginner with Spring. I'm currently trying to just run a very simple project just to start learning about Spring and understanding IoC and dependency injection. At first I created a simple ...
Gaetan L.'s user avatar
  • 685
0 votes
1 answer
95 views

I don't understand the exact difference between the dependency pull and contextualised dependency lookup. From what I understand, dependency pull involves gathering dependencies from a registry ( ...
VARMA PENUMATSA's user avatar
1 vote
2 answers
738 views

I am learning spring at the moment and cant figure out why and when we need to the use the custom @Configuration class and @Bean inside it as spring does everything automatically @Configuration and @...
abd.alabed's user avatar
0 votes
1 answer
84 views

I have two beans like this: <alias name="defaultProblematicBean" alias="problematicBean" /> <bean id="defaultProblematicBean" class="com.application....
user1532449's user avatar
0 votes
1 answer
1k views

I have a .NET 5 web application, in which I am attempting to register a particular class as a singleton instance. I know that .NET 5 is out of support now, and there are plans to upgrade this app in ...
garrett's user avatar
  • 31
0 votes
1 answer
144 views

I'm writing a desktop application in C# and using Autofac for DI. In my app I want to have a big service that depends on several smaller services that depend on each other. There should be only one ...
aelsi2's user avatar
  • 11
0 votes
1 answer
61 views

I am trying to use Redis in Spring project. And I copied some code like this and it works well: @Autowired private RedisTemplate redisTemplate; @Resource(name = "redisTemplate") ...
Sheldon Wei's user avatar
  • 1,252
1 vote
0 answers
240 views

I am exploring InversifyJS in TypeScript and I want to understand if InversifyJS will work for my use case. I have a TypeScript project with serverless lambda, Koa. I want to integrate InversifyJS and ...
Legendary_Hunter's user avatar
0 votes
1 answer
193 views

Why does this code yield a io.micronaut.context.exceptions.NonUniqueBeanException? public abstract class ObjectifyRepository<T> { } @Singleton @Named("repositoryA") public class ...
Max Bachhuber's user avatar
4 votes
0 answers
615 views

Goal: I try to display a map from Mapsui with MVVM and a service. And CommunityToolkit.Mvvm is installed and can be used for the ViewModel. My error: Exception thrown: 'System.InvalidCastException' in ...
user avatar
0 votes
0 answers
34 views

Im quite lost here guys, there's this plugin for a gameserver (https://github.com/EvolutionPlugins/Dummy/blob/openmod/Dummy/Services/DummyProvider.cs) which i need to access all the tasks from the ...
Lautaro De la Puente's user avatar
1 vote
3 answers
4k views

In clean architecture, I implement restful api as an infrastructure, the question is: what should the application layer return 1 - entity: this is what chatgpt answer, it say the application layer ...
pham vu's user avatar
  • 63
1 vote
1 answer
262 views

In my ASP.NET Core application there is a IMemoryCache registration as an instance in startup. When IMemoryCache is injected into a controller, the controller receives a different instance of memory ...
Martin Staufcik's user avatar
1 vote
1 answer
542 views

Using Template Studio for WinUI, I created an app with 2 pages, Main and Foo. If the view model is passed into the page's constructor the application generates an exception, but if the view model is ...
JasonC's user avatar
  • 338
2 votes
1 answer
3k views

I'm converting app to Maui. Old IOS through TinyIOC/FreshMvvm was FreshMvvm.FreshIOC.Container.Register<IUserDialogs>(UserDialogs.Instance); so how should that look in MauiProgram.cs using ...
tallman's user avatar
  • 201
1 vote
1 answer
624 views

I have an ASP.NET Core 7 MVC app written in C#. I want to build a custom IConfiguration to add to the providers already registered. I would like to use some services registered in the DI service ...
Skip Saillors's user avatar
1 vote
0 answers
44 views

I want use DryIoc container in web form, I use sample code : https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/ReuseAndScopes.md#reuse-and-scopes But every time I ask, I get a new instance ...
MrMohande3's user avatar
4 votes
2 answers
18k views

I know that similar questions have been asked before on this forum, but none of the proposed solutions helped me, so I am writing a separate question. The code is from the spring boot course on ...
Kamilosinni's user avatar

1
2 3 4 5
88