Skip to main content

Questions tagged [factory]

In object-oriented programming (OOP), a factory is an object for creating other objects.

2 votes
3 answers
226 views

So I have this setup with a factory: class Base; class A : public Base; class B : public Base; ... class Factory { public: Base* CreateBase(std::string TypeToCreate, const Parameters& P) ...
sayanel's user avatar
  • 509
4 votes
3 answers
3k views

Description I want to create an instance of an object at runtime, however, the parameters used to create the object are not always the same. To help explain, I have created a simplified example (in ...
zwoolli's user avatar
  • 151
5 votes
6 answers
3k views

I would want to have a builder for creating a complex object, for example Employee. I would want to be able to create my objects in two ways: Case 1. Get Employee with default values Case 2. Get ...
CuriousGuy's user avatar
2 votes
3 answers
532 views

I have a form. It contains things like grids. Users do things with these grids and what they do with them is sent to a SQL server. Clearly, the server is a volatile dependency and should be dependency ...
J. Mini's user avatar
  • 1,015
2 votes
2 answers
170 views

Consider the following python3 code: from abc import ABC, abstractmethod class Food(ABC): _food_factory_map = {} _recipes = {} @classmethod def getFood(cls, foodName): return ...
raghavj's user avatar
  • 29
29 votes
3 answers
12k views

I''m working on a C# library where the API provides several public interfaces and a single concrete factory class (itself an interface implementation). This factory provides implementations of the ...
Bondolin's user avatar
  • 403
0 votes
3 answers
244 views

A common problem I run into is when I have a Factory (let's say ThingFactory) which creates multiple different IThing implementations, and each of these concrete implementation classes requires an ...
vargonian's user avatar
  • 337
2 votes
3 answers
393 views

Context for this question I'm currently working with small data storage media (e.g. RFID tags) that contain some fixed number of bytes that can be manipulated. The drivers that allow reading bytes ...
JansthcirlU's user avatar

15 30 50 per page
1
2 3 4 5
8