257 questions
Best practices
0 votes
1 replies
45 views
How do i make a single factory for all my concrete types(functional or oop in typescript)
What is the best practice for creating the PerishableIngredient object? Also should I try to get the compiler to hint at the required fields, allow omission of optional fields, and not allow ...
1 vote
1 answer
136 views
Should/could I use Java abstract factory (or factory method) in this situation?
In a coding exercise I want to create a Java software for an hypothetical shop: I have a User superclass and three subclasses: administrator (who can manage the product catalog and the customer's list)...
1 vote
1 answer
78 views
Python Abstract Factory Pattern With Multiple Files
in my project, I have 3 separated files as mainly. My project directory Directory/ |-main.py |-scrape/ |--ScrapeFactory.py |--ScrapeFromAmazon.py ScrapeFactory.py includes from abc import ABC, ...
0 votes
2 answers
183 views
Returning multiple implementations of same interface from Abstract Factory with ASP.NET Core
I want to make multiple implementations of a specific interface accessible through an Abstract Factory in .NET Core. Based on a supplied enum the correct implementation should be returned. This is my ...
1 vote
0 answers
197 views
Abstract factory design pattern : issue handling abstractions
In a project, I have decided to try to hide all the widget toolkit details behind an abstract factory pattern. The concrete widget toolkit is gtkmm. Here is simple diagram showing the architecture I ...
1 vote
0 answers
92 views
Why constructor of a statically created object is not executed before main function if the object is defined in library?
I am trying to create "plugin" factory. When an user requests creation of an object factory queries it's child factories and picks suitable one to create the object. Instances of child ...
0 votes
1 answer
144 views
Right pattern for creating concrete classes of an interface [closed]
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 ...
1 vote
1 answer
51 views
Fixing Abstract Factory in Python
I'm trying to implement Abstract Factory pattern in Python, but after creating new "product" it simply does not work and I can't firuge out what's the problem. Here's a code: `from ...
-3 votes
1 answer
160 views
How can I have macros as arguments inside macros?
I have multiple macros at beginning of each GameObject child class header. This is intended, as the client might add any number of classes inheriting from GameObject, with any engine macro arguments. ...
4 votes
1 answer
194 views
Abstract_factory UML diagram in Wikipedia incorrect?
Referring to the UML diagram depicted in https://en.wikipedia.org/wiki/Abstract_factory_pattern#/media/File:Abstract_factory_UML.svg, one could conclude that ConcreteFactory1 and ConcreteFactory2 are ...
0 votes
1 answer
226 views
Abstract Factory Design Pattern in Software Design & Architecture
I am working to understand Abstract Factory design pattern and facing an error in many examples. As in below class diagram: Here in this example Abstract Factory class which must be an interface have ...
1 vote
1 answer
63 views
Is there a design-pattern that addresses creation of the same product in multiple different ways (requiring pipeline-like pre-creation steps)
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 ...
0 votes
1 answer
116 views
Understanding the code in an Abstract factory pattern
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 ...
0 votes
1 answer
98 views
How to use an abstract factory with realizations of an interface that have different constructor parameters?
Everything works fine till the constructors of the realizations are the same. However, I have a sort of dilemma when the constructors are different. Is it okay or maybe there is an architecture issue? ...
1 vote
1 answer
255 views
How does the prototype pattern solve the abstract factory pattern issue with many product family?
In Design Patterns Elements of Reusable Object-Oriented Software, it states that one of the issues in the Abstract factory pattern is the following: Supporting new kinds of products is difficult. ...