Skip to main content

Questions tagged [factory]

"Factory" is a general term for object-oriented programming patterns which create objects. Instead of this tag, please use tags for the specific Gang of Four patterns [factory-method] or [abstract-factory] when appropriate.

2 votes
1 answer
165 views

The way to filter objects by type in the factory

I have the factory that contains a map with the names of objects as key and pointer to function as value template<class T> static T* makeObj() { return new T(); } using createFunction = std:...
Andrii's user avatar
  • 23
0 votes
1 answer
46 views

Tic-Tac-Toe How to change gameboard array

I'm currently working on a Tic-Tac-Toe game for the odin project. The requirement for now is to get the game running purely on the console. Here's the code I've written so far: const board = { a:[ ...
Andrey's user avatar
  • 3
0 votes
0 answers
253 views

I am getting this error while using WhatsApp-web.js package for node.js related to 'WidFactory'

throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^ Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'WidFactory') at ...
Mihir Navare's user avatar
1 vote
1 answer
42 views

Do Bloc State Variables Persist when using Register Factory?

I'm using dependency injection with Bloc . When I initialize my Bloc I call: getIt.registerFactory<RemoteGroceryItemsBloc>( () => RemoteGroceryItemsBloc(getIt(),getIt())); I basically ...
Mike6679's user avatar
  • 5,927
0 votes
1 answer
51 views

How can I batch create a SQL Alchemy model using factory boy?

Here is my database model (User): from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column class SqlAlchemyBase(DeclarativeBase): """Base SQL alchemy model.""&...
theQuestionMan's user avatar
-4 votes
1 answer
57 views

C# How to initialize service that was injected via constructor [closed]

When i use dependency injection, i am trying to understand how woudl i: instantiate the injected by calling specific constructor? What if i needed to initialize this two separate instances with 2 ...
concentriq's user avatar
2 votes
1 answer
76 views

Why can't a factory be used instead of a Chain of responsibility when implementing a logger?

package com.company; enum LogLevel { DEBUG(0), INFO(1), WARN(2), ERROR(3); private final Integer enumCode; private LogLevel(Integer enumCode) { this.enumCode = ...
james gem's user avatar
  • 151
0 votes
1 answer
74 views

When is it appropriate to assign a unique_ptr to a shared_ptr?

This is a follow up to the question that was asked here: Does C++11 unique_ptr and shared_ptr able to convert to each other's type? and more specifically the top voted answer. The snippet that caught ...
Sailanarmo's user avatar
  • 1,181
0 votes
0 answers
40 views

delete instance of factory boy from another one

I have two FactoryBoy and I tried to delete the first one from the second, What I want to accomplish is when I delete a ShareLinksFactory instance, the associated WebShareFileFactoryBoy and its ...
jordan's user avatar
  • 35
0 votes
1 answer
34 views

Factory method for constructor with different params?

I am developing a software that requires to trigger alerts when certain conditions are met. Developed an abstract Alert class with send(message:string) as the send alert method. abstract class Alert ...
Matías Lareo's user avatar
2 votes
1 answer
73 views

In a swift static var extension, how to or can you access and return the concrete class?

Consider extension UIView { static var Trick: UIIView { let v = UIView() v.backgroundColor = .yellow return v } } hence addSubview(UIView.Trick) and so on. ...
Fattie's user avatar
  • 13.9k
0 votes
0 answers
129 views

Connecting to Oracle Cloud database from Azure Data Factory using TLS

I'm trying to connect from Azure Data Factory (linked service) to a free Oracle dB on their cloud service. It's failing with this error: ERROR [HY000] [Microsoft][ODBC Oracle Wire Protocol driver]SSL ...
RichC's user avatar
  • 69
0 votes
1 answer
162 views

Linking On-Premise Data Gateway to Azure Data Factory

I am trying to connect to an on-premise Oracle database in order to sync some tables to an Azure SQL Server database. I believe that Data Factory is the best tool to use for these kind of bulk data ...
bobster2dope's user avatar
0 votes
1 answer
61 views

Call to undefined function Database\Seeders\factory() [closed]

I have that error, since i create a UserFactory and in my UserTableSeeder add this line factory(App\User::class,10)->create(); here a picture In my UserTableSeeder i replace factory(App\User::class,...
user avatar
2 votes
3 answers
65 views

How to make a class that returns an instance without `new` keyword

I would like to create a class that would work like, for example, the built-in BigInt. So I can do: BigInt('111') BigInt('222').toString() Please guide me on how to code it. I'm using NodeJS with ...
Fox Reymann's user avatar

15 30 50 per page
1
2 3 4 5
213