Questions tagged [abstract-factory]
The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes.
41
questions
1
vote
1
answer
71
views
Python3 tokenizer abstract baseclass ( Without the permission to be instantiated directly )
I'm a newbie python developer, and fortunately I have been introduced to the principle of abstract base classes and they seemed pretty interesting to tackle while going forward in my Python journey.
I'...
1
vote
1
answer
97
views
Take meal orders from breakfast, lunch and dinner menus
I have an exercise requires me to write a service to management menu.
The requirement like this:
Food menu includes: breakfast menu, lunch menu, dinner menu. The three menu haves list menu item( name, ...
4
votes
2
answers
144
views
Abstract Factory Implementation C#
I'm learning Factory pattern and I've implemented this simple example of an abstract factory. I've followed this video a little bit while writing this small example. Is there anything anti-pattern or ...
1
vote
1
answer
440
views
Helper functions for use with std::variant without an actual object
Sometimes, you want to an type of a particular index in an std::variant, and do something with that type without having an actual object. An example use-case would be de-serialization. What do you ...
3
votes
3
answers
277
views
A refactored payment service, handling several payment schemes
I was asked to refactor a class, to make it adhere to SOLID principles, with testability and readability. I thought I had done a decent job, only my feedback was:
a) Unnecessary introduction of ...
1
vote
0
answers
434
views
Caching wrapper with multi-providers and factory to detect the responsible cache provider related to Type
What I'm trying to do
abstract the caching actual cache provider (memory || distributed || ...).
enable a caching diversity. each cached item type has different ...
3
votes
1
answer
1k
views
Abstract Factory in C++
I have tried my hand at the abstract factory pattern in C++:
...
1
vote
2
answers
1k
views
Using Factory Design Pattern in Rest Controller of Spring
I used factory design pattern to identify the service according to the enum that comes from the api uri as request param. Everything seems okay according to me but cannot be sure if I used it right.
<...
0
votes
1
answer
954
views
The Abstract Factory design pattern as a Database Operations program
File - DatabaseOperations.h
This file contain classes representing database operations for three different types of databases (relational, document based and graph based) like establishing connections,...
0
votes
2
answers
762
views
Factory / Builder Design Pattern in Python
Situation: I have implemented a factory design pattern in Python as below. There are different screens which have different configurations. One can register the screen in the factory and get the ...
0
votes
1
answer
255
views
Best practice for factory pattern in c++?
I'm implementing a simple data reader to get image sequences from either a pre-recorded video file (In my case ROS bag file), or a camera device (In my case Intel Realsense). Basically I intend for ...
3
votes
1
answer
316
views
Abstract Factory Pattern in Python
I have been reading today about the Abstract Factory Pattern, and tried to make the following implementation.
I have seen a lot of implementations in the internet, where they use ...
2
votes
0
answers
266
views
Swift Struct-based Factory Pattern
Edit: I added another configuration vector to CardView, a size attribute, which may be .small or ...
32
votes
5
answers
5k
views
Chess game for my students
I teach programming, and I currently teach my class about inheritance, abstract classes, and mixins.
I wrote this code as an example, and I want to be sure it is as good as possible before I release ...
3
votes
1
answer
855
views
Building an email generator using abstract factory pattern
I'm trying to build a customer email generator in java using the abstract factory pattern. I understand how to use the factory method pattern; however, I'm a bit confused about the abstract factory ...