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 { ...

Get Design Patterns Java™ Workbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.