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
228 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
0 votes
2 answers
177 views

I'm working on a TypeScript application designed with DDD and using layered architecture. My infra layer has a repository that fetches a complex, nested DTO. My current implementation maps this DTO ...
Bernardo Benini Fantin's user avatar
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
3 votes
1 answer
216 views

I am seeking clarification on the exact purpose and definition of the Abstract Factory pattern. According to the GoF (Gang of Four) book, the intent of the pattern is to: Provide an interface for ...
Codisattva's user avatar
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
0 votes
2 answers
456 views

I am a frontend developer (currently working with Vue and TS), and I have been searching for better organization of the frontend code and recently I got to know DDD a bit. I know DDD is mostly used ...
Bernardo Benini Fantin's user avatar
2 votes
3 answers
535 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
5 answers
577 views

I have a testing project, in Katalon Studio, that uses data classes, called models. This is a conscious design decision. Also a conscious design decision, is the decision to separate the concern of ...
Mike Warren's user avatar
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
0 votes
1 answer
67 views

I am using this DTO class to pass object between web application layers public class CreateProgressDTO { public int Total { get; set; } public int Created { get; set; } public decimal ...
dafie's user avatar
  • 109
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
4 answers
4k views

I design a common API for selected printers of different brands in Java. Each printer uses a different underlying SDK with different functions, but any hardware my code runs on will have only one ...
Martin Braun's user avatar
0 votes
3 answers
245 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
0 votes
1 answer
844 views

Here is the conundrum, I have a fairly complex Value Object and I don't want to expose it's internals. It should not be an Entity since there is no need for attaching an identity to it. According to ...
Tetra's user avatar
  • 3
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