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