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_7

7. Adapters

Edward Sciore1 
(1)
Newton, MA, USA
 

The next two chapters examine a design technique known as wrapping. Wrapping denotes a close relationship between two classes, called the wrapper class and the wrapped class. The sole purpose of the wrapper class is to modify or enhance the functionality of its wrapped class. Wrapping corresponds perfectly to the Open/Closed design rule: If you need a class to behave slightly differently then don’t modify it. Instead, create a new class that wraps it.

This chapter covers the concept of an adapter, which is a wrapper that changes the functionality of the class it wraps. This chapter presents several examples ...

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