Skip to Content
Java Program Design: Principles, Polymorphism, and Patterns
book

Java Program Design: Principles, Polymorphism, and Patterns

by Edward Sciore
December 2018
Intermediate to advanced
465 pages
8h 5m
English
Apress
Content preview from Java Program Design: Principles, Polymorphism, and Patterns
© Edward Sciore 2019
Edward ScioreJava Program Designhttps://doi.org/10.1007/978-1-4842-4143-1_4

4. Strategies

Edward Sciore1 
(1)
Newton, MA, USA
 

Class hierarchies are a fundamental feature of object-oriented programming languages. Chapter 3 examined their capabilities. This chapter examines their (often significant) limitations and introduces the more flexible concept of a strategy hierarchy. Strategy hierarchies are a central component of several design techniques. This chapter examines two such techniques—the strategy pattern and the command pattern—and their uses.

The Strategy Pattern

Let’s begin by reviewing the template pattern from Chapter 3. In it, an abstract class (known as the template) provides a skeletal implementation of each public method, ...

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 and SOLID Principles with Java

Design Patterns and SOLID Principles with Java

Róbert Kohányi
Design Patterns and Best Practices in Java

Design Patterns and Best Practices in Java

Kamalmeet Singh, Ianculescu, Lucian-Paul Torje

Publisher Resources

ISBN: 9781484241431Purchase LinkPublisher Website