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.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
355 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 ...
5
votes
0answers
151 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 ...
5
votes
0answers
156 views

2d game enemy entities factories, probably in need of refactoring

So I'm making a 2d shoot'em up game as a way of learning canvas, and larger-scale programming than what I'm accustomed to. I'm a purely front-end web dev, I can't say I'm very experienced in this. ...
4
votes
0answers
74 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 ...
4
votes
0answers
168 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: ...
3
votes
0answers
126 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 ...
3
votes
0answers
194 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 ...
2
votes
0answers
98 views

Swift Struct-based Factory Pattern

Edit: I added another configuration vector to CardView, a size attribute, which may be .small or ...
2
votes
0answers
306 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: ...
2
votes
0answers
600 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 ...
2
votes
0answers
483 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 ...
2
votes
0answers
440 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 ...
1
vote
0answers
23 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). ...
1
vote
0answers
34 views

Factory method to make JSON requests for various types of list items

I have the following code: ...
1
vote
0answers
57 views

Creating objects by defined name

I'm trying to write universal factory creating objects by name. I've got some working prototype now but there must be a better way than casting construction methods to void pointer. ...
1
vote
0answers
1k views

AngularJS factory, return object to be used again in factory

I'm trying to create a wrapper / factory around the cordova media plugin, which requires you to create a new Media object, and then use it again to pause, stop, play, etc it. The factory + link to ...