Lecture overview -- Keyboard shortcut: 'u'  Previous page: The fragile base class problem -- Keyboard shortcut: 'p'  Next page: The design pattern Factory Method -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 34 : 41
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns
Factory design patterns

There exists design patterns that insulate clients from the actual instantiation of a class C

 

  • Overview:

    • Factory methods implemented with class methods (static methods) in C, or in another class

    • The design pattern Factory Method which handles instantiation in instance methods of client subclasses

      • Relies on instance methods in class hierarchies with virtual methods

    • The design pattern Abstract Factory which is good for instantiation of product families

      • Relies on instance methods in class hierarchies with virtual methods