Top "Factory-pattern" questions

This tag is sometimes used to refer to the Factory Method pattern ([factory-method]) and sometimes used to refer to the Abstract Factory pattern ([abstract-factory]). Please use either of those tags instead of this one.

Factory Pattern but with object Parameters

Take the following classic factory pattern: public interface IPizza { decimal Price { get; } } public class HamAndMushroomPizza : IPizza { decimal IPizza.Price { get { …

c# design-patterns factory-pattern
About factory constructor in Dart

Below is about a usage of factory constructor from Seth Ladd's blog ' Dart - Trying to understand the value …

constructor dart factory-pattern
using the command and factory design patterns for executing queued jobs

I have a list of jobs queued in the database which I need to read from database and execute them …

c# design-patterns factory-pattern command-pattern
Factory Pattern - CreateInstance static or not?

This is about the Factory Pattern. I am a little confused. I saw implementations where the createInstance() method is static …

design-patterns factory factory-pattern factory-method static-factory
Laravel 4: Confused about how to use App::make()

I am trying to follow the repository pattern outlined in this article http://code.tutsplus.com/tutorials/the-repository-design-pattern--net-35804#highlighter_174798 And …

php laravel laravel-4 factory-pattern
Generics & Reflection - GenericArguments[0] violates the constraint of type

I've been pulling my hair out for awhile on this one, essentially I'm trying to implement a generic repository factory, …

c# .net generics reflection factory-pattern
c++ automatic factory registration of derived types

Like many before me, I'm trying so get my derived types to automatically register with my factory. I read through …

c++ templates static-methods factory-pattern
Factory pattern in Python

I'm currently implementing the Factory design pattern in Python and I have a few questions. Is there any way to …

python design-patterns factory factory-pattern
Factory Pattern without a Switch or If/Then

I'm looking for a simple example of how to implement a factory class, but without the use of a Switch …

c# factory factory-pattern
Unity: Register and resolve class with generic type

I'm using Unity and try to follow to SOLID-principles as far as possible. Therefore all implementations only have dependencies to …

c# inversion-of-control unity-container factory-pattern