Skip to main content
-1 votes
3 answers
161 views

I was reading an e-book explaining design patterns, and after explaining the factory design pattern, it suggests some improvements. One of them was to make the factory static. Make the factory (or a ...
FOXDeveloper's user avatar
3 votes
2 answers
242 views

In my application I want to have an EventPersister trait that defines an abstraction of persisting events, then have various implementations that, for example, persist events in memory, in the file ...
bikeman868's user avatar
  • 2,685
0 votes
0 answers
44 views

I am facing an issue with my spring-boot application. The API is using the factory design pattern along with JpaRepository. The API manages creation of "Route" which is "Road" in ...
Himmels DJ's user avatar
0 votes
0 answers
102 views

Considering the following example: A class named ObjectFactory is defined to manage the creation of several classes. These managed classes should be registered with the factory so that we can create ...
Woody Huang's user avatar
2 votes
1 answer
184 views

I have the factory that contains a map with the names of objects as key and pointer to function as value template<class T> static T* makeObj() { return new T(); } using createFunction = std:...
Andrii's user avatar
  • 23
0 votes
2 answers
706 views

The Python version of the Factory pattern in Refactoring Guru is: from __future__ import annotations from abc import ABC, abstractmethod class Creator(ABC): @abstractmethod def factory_method(...
Jay's user avatar
  • 134
0 votes
2 answers
339 views

I'm trying to understand how to create an instance of a service (for example, ITransport) with some input config at runtime using the Factory Pattern and Dependency Injection (Microsoft.Extensions....
Taras's user avatar
  • 79
2 votes
1 answer
93 views

Based on this topic, I wonder if it would be possible to have a factory class that would provide a container type, without defining the type of element of the container. Something like: template <...
canellas's user avatar
  • 757
0 votes
0 answers
49 views

I used to use factory method as a creational design pattern, but now I got stucked in the situation which is reversing the problem. The normal behavior to create the factory pattern. I am facing the ...
abdekrazek mostafa's user avatar
0 votes
0 answers
123 views

I am following factory design pattern . From the view model state response I am rendering the view. For movie details view I am rendering MovieDetailsDisplayViewController. view content. Here is view ...
user avatar
0 votes
1 answer
107 views

I'm currently reading book pro spring 6. I am a bit confused on one example from book Here is the main class: public class HelloWorldDecoupledWithFactory { public static void main(String... args)...
houhou's user avatar
  • 41
0 votes
2 answers
288 views

By definition, dependency injection promotes loosely coupled, maintainable, and testable code, and using interface and constructor injection we can get the object of the class implementing the ...
Sandhya Ratan's user avatar
0 votes
1 answer
49 views

So I was reading along Design Patterns book to look up some details on the Factory Pattern. I was reading about two main variants of implementation: Using the abstract Factory and ConcreteFactories ...
John Doe's user avatar
2 votes
2 answers
3k views

I have six implementations for the same interface registered on my DI container, like so: services.AddScoped<IProductService, ProductService1>(); services.AddScoped<IProductService, ...
Anna Aimeri's user avatar
0 votes
1 answer
116 views

I am trying to build a flask app and using mod_wsgi server for hosting. I use a factory function to create the flask app but I observe that mod-wsgi calls the factory function twice within the same ...
Kevin123's user avatar

15 30 50 per page
1
2 3 4 5
99