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.

WCF Dependency injection and abstract factory

I have this wcf method Profile GetProfileInfo(string profileType, string profileName) and a business rule: if profileType is "A" read …

wcf dependency-injection factory-pattern
Activator.CreateInstance: Dynamic Instantiation of Classes

I am designing a loosely-coupled structure. I want to call classes from different assemblies/namespaces via a code which is …

c# factory-pattern activator
Replace factory with AutoFac

I'm accustomed to creating my own factories as shown (this is simplified for illustration): public class ElementFactory { public IElement Create(…

c# autofac factory-pattern
Factory pattern to create Exceptions dynamically

I have created Exception xml and dynamically create and throw exception. <exception-mappings> <exception-mapping key="exceptionkey1"> <…

java exception-handling factory-pattern
Factory / Abstract Factory confusion

After ~10 months of procedural PHP, I'm now trying to wrap my head around basic OOP principles and design patterns. This …

php oop design-patterns factory factory-pattern
Factory implemented with static method

I have seen an implementation of Factory using static methods. Something like this: public class MyFactory { public static Product1 createProduct1() {} …

design-patterns static factory factory-pattern abstract-factory
Factory Pattern to build many derived classes

I have a factory object ChallengeManager to generate instances of a Challenge object for a game I'm building. There are …

c# design-patterns factory-pattern