Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [factory-method]

Use this tag for code reviews of, or involving methods that create a new instance of a given type, often with parameters that determine how the instance gets created.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
0 answers
1k views

Private VBA Class Initializer called from Factory #2

About This is a follow-up of a previous question Private VBA Class Initializer called from Factory. I've decided to create a new question instead of answering my old question because I would like the ...
Cristian Buse's user avatar
5 votes
0 answers
256 views

Factory class that uses reflection to instantiate objects by class name

In this SO post Dynamically choose class from string Alexander Platonov creates a Function on the fly and then uses Application.Run() to instantiate an Object by ...
TinMan's user avatar
  • 4,133
4 votes
0 answers
85 views

Chained Factories by Expression Template

I want to make factories that can chained together to create a pile of layers. One of the advantage of chained factories is that later factories can pass specifications to earlier factories. For ...
R zu's user avatar
  • 287
4 votes
0 answers
231 views

Extensible factory method for starting D3 charts

I'm working on refactoring some existing code to be a bit more extensible and am wanting to create a generic factory API for starting D3 charts. Currently, my factory looks like this: ...
aendra's user avatar
  • 141
4 votes
0 answers
619 views

Compile-time plugin system (2)

Background This is a follow-up of this CR: Compile-time plugin system. The code exposed below can also be browsed on this gist, which shows the differences between both questions (original is version ...
Cilyan's user avatar
  • 285
3 votes
0 answers
133 views

Angular OOP services and caching

I've created a caching service using OOP techniques combined with the revealing module pattern and the angular-cache library. New CacheDataClass objects are ...
br3w5's user avatar
  • 255
3 votes
0 answers
223 views

Threadsafe singleton factory to use in Apache thrift server RPC system

My goal was to write a factory that the code did not have to be edited. Thus I am registering my factory functions into a singleton factory. I am going to be using this code in Apache thrift server ...
user249806's user avatar
2 votes
0 answers
265 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
2 votes
0 answers
351 views

Show mobile SoundCloud player in WebView

Demo for a SoundCloud player in WebView for specific song or artist stream as a workaround because SoundCloud is not accepting API key request anymore. SoundCloudWebView: ...
Vhalad's user avatar
  • 91
2 votes
0 answers
611 views

Simple files parsing and info extraction

First let me describe the problem, we want to solve: We have hierarchical directories structure with different types of templates. Each type of templates is located in dedicated folder. Hierarchical ...
Jevgenij Nekrasov's user avatar
2 votes
0 answers
502 views

Factory (pattern) of Commands (pattern) with additional dependency injection (dependency inversion pattern)

What would you improve at the following code, except: The problems I'm already aware of, marked as TODO Line width of at most 120 characters (I've run flake8 over ...
Flavius's user avatar
  • 129
1 vote
0 answers
30 views

Logs UI errors to a service provided in the configuration

As part of the project I am currently working on we want to log our UI component errors as well. I developed this package as a base. It's a factory (basically, not sure if it's correctly a factory). ...
Andreas Andreou's user avatar