Skip to main content

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.

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'...
KhodeNima's user avatar
  • 399
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, ...
David Moore's user avatar
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 ...
Hammas's user avatar
  • 141
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 ...
user877329's user avatar
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 ...
zola25's user avatar
  • 140
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 ...
Shrembo's user avatar
  • 151
3 votes
1 answer
1k views

Abstract Factory in C++

I have tried my hand at the abstract factory pattern in C++: ...
Fang's user avatar
  • 545
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. <...
Abdu Muhammadal's user avatar
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,...
StewieGGriffin's user avatar
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 ...
rkarft's user avatar
  • 3
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 ...
zhouch's user avatar
  • 3
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 ...
revliscano's user avatar
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 ...
Richard Robinson's user avatar
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 ...
Infinity's user avatar
  • 505
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 ...
rafiaTech's user avatar
  • 131

15 30 50 per page