O'Reilly logo

Design Patterns Java™ Workbook by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Abstract Factory (Chapter 17)

SOLUTION 17.1Figure B.21 shows a solution to providing concrete com.oozinoz.check.canada classes that implement the interfaces and abstract class in com.ooz-inoz.check. One subtlety is that you need only one concrete class for offline credit checking, because at Oozinoz, offline checking is the same for calls from the United States and Canada.
Figure B.21. The canada package provides a family of concrete classes that conduct a variety of checks for Canadian calls.

SOLUTION 17.2Here is one solution:
 package com.oozinoz.check.canada; import com.oozinoz.check.*; public class CheckFactoryCanada extends CheckFactory { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required