Skip to main content
Filter by
Sorted by
Tagged with
-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
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
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
335 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
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
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
1 answer
48 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
0 votes
1 answer
110 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
0 votes
1 answer
337 views

I have been reading system design of an amazon shopping website like system on educative, it is mentioned in the solution that In the Amazon online shopping system, we can use the Factory design ...
Thejesh's user avatar
  • 31
0 votes
1 answer
144 views

I have an interface which is implemented by different classes. I want to make the implementation classes package private so that clients only use the interface, but of course they somehow need to ...
Rob's user avatar
  • 13
0 votes
0 answers
208 views

So I'm currently working on a GUI in PyQt5 and I'm creating a window based off of a yaml settings file that contains information about what widgets should be contained within the window and some of ...
mrwobbles's user avatar
0 votes
3 answers
256 views

I face a problem with derived classes having their own functions when using Factory Pattern. Please share how you design OOP in this case. Assume I have a general class B, and many derived classes, ...
dungdq's user avatar
  • 1
0 votes
2 answers
110 views

I have this code which is an adaptation from How to pass arguments to factory elements constructors? to work with smart pointers. #include <unordered_map> #include <string> #include <...
user avatar
1 vote
1 answer
250 views

I usually write something like this for my DI: var serviceProvider = new ServiceCollection() .AddSingleton<ISomething, Something>() .AddSingleton<IOutputMaker, ...
UnskilledCoder's user avatar
0 votes
1 answer
48 views

I am facing this error "Can not find module src" while executing command pytest. My create_app function is inside src/ __init__.py The structure of project is project src ...
annonymous's user avatar
0 votes
1 answer
124 views

I have created a small chess game and implemented a factory class to produce game pieces. However, I realized that my implementation is not ideal, as every game piece is responsible for registering ...
DanielG's user avatar
  • 297
0 votes
1 answer
139 views

I have defined an interface IEmailManager as having send method. The email controller is using its concrete type EmailManager as a constructor dependency that sends the email. public interface ...
Engr Umair's user avatar
1 vote
2 answers
89 views

There are like these types interface A { id: number name: string patternA: patternA[] } interface B { id: number name: string patternB: patternB[] } interface C { id: number name: ...
kazon's user avatar
  • 412
4 votes
1 answer
14k views

Question Hello, the following code example throws the error: TypeError: Super constructor null of SecondChild is not a constructor at new SecondChild (<anonymous>:8:19) at <anonymous&...
InProgress's user avatar
0 votes
1 answer
69 views

class A(Factory): def func1(self, param1): print(param1 + " class A") def func_A(self): print("Func A") class B(Factory): def func1(self, param1): print(param1 + ...
Rishabh Das's user avatar
1 vote
1 answer
63 views

I am currently working on a machine learning project and would like my Python program to be able to process/convert measurement data from various measurement data formats into a PyTorch compatible ...
J. Lo's user avatar
  • 179
0 votes
0 answers
68 views

I just started using Autofac. How do I register multiple components? I see this in the QuickStart guide: private static IContainer Container { get; set; } . . . var builder = new ContainerBuilder(); ...
BigSargeNCharge's user avatar
0 votes
1 answer
109 views

I am trying to learn design patterns in C# and my friend has written me some code for an Abstract factory pattern (I think). from what I am seeing the code creates a factory(Fa), this factory(Fa) then ...
Clas Antics's user avatar
0 votes
1 answer
120 views

I have a library for 3D geometry. The library has classes like Point, Vector, Axis, Plane etc. The library has an interface and implementation hierarchy but simply all classes inherits from ...
Baris's user avatar
  • 43
1 vote
1 answer
157 views

I'm trying to create a linked list using a factory function. When I run the method append on the list console.log displays the correct value. The prepend method on the other hand doesn't seem to be ...
Laws's user avatar
  • 23

1
2 3 4 5
30