Skip to main content
This is lesson 3 of 11 in this module Course 93% complete

Class Factories in C#

Premium Content

Sign in with your account or sign up to access this lesson.

We cover the class factory pattern for runtime-determined type instantiation, comparing a hard-coded switch statement with Activator.CreateInstance. The lesson explains why reflection is inherently expensive and hints at a faster third approach using dynamic methods.