Take the following classic factory pattern:
public interface IPizza { decimal Price { get; } } public class HamAndMushroomPizza : IPizza { decimal IP
You can use reflection:
using System.Reflection; // ... public override IPizza CreatePizza(PizzaType pizzaType, params object[] parameters) { return (IPizza) Activator.CreateInstance( Assembly .GetExecutingAssembly() .GetType(pizzaType.ToString()), parameters); }