Chapter 12. Advanced Design Patterns

In yesterday’s chapter, you saw how design patterns allow you to reuse time-tested designs. Today, you will continue your study of design patterns by examining three more patterns.

Today you will learn

  • About three important design patterns

  • How to make sure that your objects remain single

  • How to enhance a previous example

  • About some common pattern pitfalls that you should avoid

More Patterns by Example

Let’s continue your study of design patterns by considering three important patterns:

  • Abstract Factory

  • Singleton

  • Typesafe Enum

Each of these patterns find their way into almost every design. In fact, you can use the Typesafe Enum pattern to fix up an example from Chapter 3, “Encapsulation: Time to Write Code!”

The Abstract ...

Get Sams Teach Yourself Object Oriented Programming in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.