Skip to Content
Design Patterns Explained: A New Perspective on Object-Oriented Design
book

Design Patterns Explained: A New Perspective on Object-Oriented Design

by Alan Shalloway, James R. Trott
July 2001
Beginner to intermediate
368 pages
6h 52m
English
Addison-Wesley Professional
Content preview from Design Patterns Explained: A New Perspective on Object-Oriented Design

More Requirements for the Case Study

In the process of writing the application, suppose I get a new requirement to take the following actions whenever a new customer is entered into the system:

  • Send a welcome e-mail to the customer.

  • Verify the customer's address with the post office.

Are these all of the requirements? Will things change in the future?

If I am reasonably certain that I know every requirement, then I could solve the problem by hard-coding the notification behavior into the Customer class, such as shown in Figure 17-1.

Figure 17-1. Hard-coding the behaviors.

For example, using the same method that adds a new customer into the database, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition

Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition

Alan Shalloway, James R. Trott
Design It!

Design It!

Michael Keeling

Publisher Resources

ISBN: 0201715945Purchase book