Author(s): Edward Lavieri
Publisher: Packt
Year: 2020
Language: English
Pages: 347
Tags: java design pattern 2020
Cover
Title Page
Copyright and Credits
Dedication
About Packt
Contributors
Table of Contents
Preface
Section 1: Introducing Design Patterns
Chapter 1: Unified Modeling Language Primer
Technical requirements
Introducing UML
Understanding behavioral UML diagrams
Activity diagrams
Interaction diagrams
Sequence diagrams
Communication diagrams
Timing diagrams
State machine diagrams
Use case diagrams
Understanding structural UML diagrams
Class diagrams
Component diagrams
Composite structure diagrams
Deployment diagrams
Object diagrams
Package diagrams
Summary
Questions
Further reading
Chapter 2: Object-Oriented Design Patterns
Technical requirements
Introduction to object-oriented programming
Primary benefits of OOP
Portability
Inheritance
Encapsulation
Polymorphism
Sample OOP class
Instance variables
The this reference
Object-oriented programming approaches
Accessors and mutators
Driver class
Constructors
Overloading constructors and methods
Method call chaining
Principles of design patterns
Creating concise objects
Encapsulating to protect
Being purposeful with inheritance
Learning the complete OOP class
Summary
Questions
Further reading
Section 2: Original Design Patterns
Chapter 3: Behavioral Design Patterns
Technical requirements
Introducing behavioral design patterns
Understanding the chain of responsibility pattern
Use case
UML class diagram
Programming the design pattern
University email handler interface
Main email handler
Academic email handler
Alumni email handler
Advising email handler
Finance email handler
HR email handler
Admin email handler
Exploring the command pattern
Use case
UML class diagram
Programming the design pattern
Class variables
Constructor
Accessor methods
Power-related methods
Slider-related methods
Using the interpreter pattern
Use case
UML class diagram
Programming the design pattern
The Expression interface
The MapIntToCharacters class
The Conversion class
InterpreterDriver class
Using the iterator pattern
Use case
UML class diagram
Programming the design pattern
Understanding the mediator pattern
Use case
UML class diagram
Programming the design pattern
Starter
AssemblySystem
Hopper
The SystemAccelerator class
EmergencyBreak
WidgetProductionSystem
Examining the memento pattern
Use case
UML class diagram
Programming the design pattern
Using the null object pattern
Use case
UML class diagram
Programming the design pattern
Observing the observer pattern
Use case
UML class diagram
Programming the design pattern
Understanding the state pattern
Use case
UML class diagram
Programming the design pattern
PrinterOnLine
PrinterOffLine
Printer
PrinterController
Driver
Application output
Strategizing with the strategy pattern
UML class diagram
Understanding the template method pattern
Understanding the visitor pattern
Summary
Questions
Further reading
Chapter 4: Creational Design Patterns
Technical requirements
Introducing creational design patterns
Understanding the abstract factory design pattern
Use case
UML class diagram
Programming the design pattern
Interfaces
Abstract Factory class
TypeA classes
TypeB classes
Type-C classes
Driver class
Building with the builder design pattern
Use case
UML class diagram
Programming the design pattern
Roaster class
Interface
Builder classes
Director class
Driver class
Exploring the factory method design pattern
Use case
UML class diagram
Programming the design pattern
Using the prototype design pattern
Use case
UML class diagram
Programming the design pattern
Examining the simple factory design pattern
Use case
UML class diagram
Programming the design pattern
Implementing the singleton design pattern
Use case
UML class diagram
Programming the design pattern
Summary
Questions
Further reading
Chapter 5: Structural Design Patterns
Technical requirements
Introduction to structural design patterns
Understanding the adapter design pattern
Use case
UML class diagram
Programming the design pattern
Crossing the bridge design pattern
Learning about abstraction
Implementing the abstraction example
Use case
UML class diagram
Programming the design pattern
Combining objects with the composite design pattern
Use case
UML class diagram
Programming the design pattern
Understanding the decorator design pattern
Use case
UML class diagram
Programming the design pattern
Implementing the facade design pattern
Use case
UML class diagram
Programming the design pattern
Soaring with the flyweight design pattern
Use case
UML class diagram
Programming the design pattern
Implementing the proxy design pattern
Use case
UML class diagram
Programming the design pattern
Summary
Questions
Further reading
Section 3: New Design Patterns
Chapter 6: Architectural Patterns - Part I
Introducing architectural patterns
Understanding the blackboard pattern
Coffee shop automation example
Warehouse security bot example
Understanding the broker pattern
University enterprise information system example
Luxury cruise reservation system example
Understanding the client-server pattern
Coffee shop example
Three-tier example
Understanding the event-driven pattern
Event-driven architectural pattern – broker
Event-driven architectural pattern – mediator
Understanding the extract-transform-load pattern
Extract
Transform
Load
Understanding the layered pattern
Traditional operating system layers example
Mobile operating system layers example
Business application layers example
Understanding the master–slave pattern
Single client example
Cloud storage example
Understanding the microkernel pattern
Construction quote example
Optical disc player example
Summary
Questions
Further reading
Chapter 7: Architectural Patterns - Part II
Technical requirements
Understanding the microservices pattern
Logistics example
eCommerce example implementation
Understanding the model-view-controller pattern
Book model-view-controller example implementation
Book class
BookView class
The BookController class
The MVCArchitecturalPattern class
Understanding the naked object pattern
Understanding the peer-to-peer pattern
File sharing example implementation
Networking example implementation
Understanding the pipe-filter pattern
Simple transformation example implementation
Complex transformation example implementation
Understanding the serverless pattern
IaaS implementation
PaaS implementation
SaaS implementation
BaaS implementation
MBaaS implementation
FaaS implementation
Understanding the service-oriented pattern
Understanding the space-based pattern
Summary
Questions
Further reading
Chapter 8: Functional Design Patterns
Technical requirements
Introducing functional design patterns
Understanding the execute around design pattern
Demonstrated implementation
Understanding the lambda design pattern
Accessing variables
Implementing lambda with a single parameter
Implementing lambda with multiple parameters
Understanding the loan design pattern
Implementing file processing
Understanding the MapReduce design pattern
Input-Map-Output
Input
Map
Output
Input-Map-Reduce-Output
Input
Map
Reduce
Output
Input-Multiple Maps-Reduce-Output
Input
Multiple maps
Input-Map-Combiner-Reduce-Output
Understanding the memoization design pattern
Understanding the streams design pattern
Stream intermediate operations
Stream terminal operations
Programming the streams design pattern
Understanding the tail call design pattern
Programming the tail call design pattern
Summary
Questions
Further reading
Chapter 9: Reactive Design Patterns
Technical requirements
Introducing reactive design patterns
Responsive
Resilient
Elastic
Message-driven
Understanding the asynchronous communication design pattern
Implementing the asynchronous communication design pattern
Understanding the autoscaling design pattern
Horizontal scaling
Vertical scaling
Implementing autoscaling
Understanding the bounded queue design pattern
Understanding the bulkhead design pattern
Understanding the caching design pattern
Implementing the caching design pattern in Java
Understanding the circuit-breaker design pattern
Use case
Understanding the event-driven communication design pattern
Understanding the fail-fast design pattern
Programming the design pattern
Introducing a fail event
Understanding the failure-handling design pattern
Failure isolation
Controlled failure
Understanding the fan-out and quickest-reply design pattern
Understanding the idempotency design pattern
Programming the design pattern
Understanding the monitoring design pattern
Understanding the publisher-subscriber design pattern
Understanding the self-containment design pattern
Understanding the stateless design pattern
Use case
UML class diagram
Programming the design pattern
Summary
Questions
Further reading
Assessments
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Other Books You May Enjoy
Index