1
1 1 The Abstract Factory groups part creation for a family of parts so the family can be changed. § Define an common interface for each family element that the application uses § Define a class that is responsible for creating all elements in the family via a factory method for each element § Application instantiates desired factory 2 MotifFactory getWindow() getButton() Win32Factory getWindow() getButton() Example: WidgetFactory WidgetFactory getWindow() getButton() MotifWindow Win32Window Window MotifButton Win32Button Button

The Abstract Factory groups part creation for a family of ...se362/PatternOverviews/AbstractFactory.pdf · The Abstract Factory groups part creation for a family of parts so the family

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

1

1

The Abstract Factory groups part creation for a family of parts so the family can be changed.

§ Define an common interface for each family element that the application uses

§ Define a class that is responsible for creating all elements in the family via a factory method for each element

§ Application instantiates desired factory

2

MotifFactory

getWindow()getButton()

Win32Factory

getWindow()getButton()

Example: WidgetFactory

WidgetFactory

getWindow()getButton()

MotifWindowWin32Window

Window

MotifButtonWin32Button

Button