Your SlideShare is downloading. ×
0
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Abstract Factory Pattern
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Abstract Factory Pattern

1,701

Published on

Presentation given at Melbourne Patterns Group (Sept 2005)

Presentation given at Melbourne Patterns Group (Sept 2005)

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,701
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
59
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Abstract Factory Pattern Provide an interface for creating families of related or dependent objects without specifying their concrete classes
  • 2. Design Strategies recommended by GoF <ul><li>Design to Interfaces </li></ul><ul><li>Favour composition over inheritance </li></ul><ul><li>Find what varies and encapsulate it </li></ul>
  • 3. Themes of Creational Patterns <ul><li>Encapsulate Knowledge about which concrete classes the system uses </li></ul><ul><li>Hide how these classes are created and put together </li></ul>
  • 4. Applicability <ul><li>A system independent of how products are created </li></ul><ul><li>Independent families of products can be used </li></ul><ul><li>Within a family, sibling products should be use together </li></ul><ul><li>Reveal Interfaces of class library and hide implementation </li></ul>
  • 5. Implementation <ul><li>Factory Method </li></ul><ul><li>Prototype </li></ul><ul><li>Builder </li></ul>
  • 6. Abstract Factory using Factory Method
  • 7. Consequences of Classic Abstract Factory <ul><li>It isolates concrete classes </li></ul><ul><li>Exchanging product families harder </li></ul><ul><li>Consistency among products harder to enforce </li></ul><ul><li>Supporting new kinds of products is difficult </li></ul>
  • 8. Pluggable Factory John Vlissides C++ Report, February 1999
  • 9. Consequences of Pluggable Factory <ul><li>Class structure is simpler </li></ul><ul><li>The factory interface tends to be more complex </li></ul><ul><li>Changing individual product types is easy. </li></ul><ul><li>Exchanging product families harder </li></ul><ul><li>Consistency among products harder to enforce </li></ul>
  • 10. Implementation - 2 nd Dimension <ul><li>Dedicated Creators </li></ul><ul><li>Parameterized Creators </li></ul>
  • 11. Extensible Factories Timothy R. Culp C++ Report, October 1999
  • 12. Consequences of Extensible Factories <ul><li>Supporting new kinds of products is easier </li></ul><ul><li>Products are returned with same Interface </li></ul><ul><li>Less type safety </li></ul><ul><li>Exchanging product families harder </li></ul><ul><li>Consistency among products harder to enforce </li></ul>

×