TL;DR: The book is an introduction to the idea of design patterns in software engineering, and a catalog of twenty-three common patterns, which most experienced OOP designers will find out they've known about patterns all along.
Abstract: The book is an introduction to the idea of design patterns in software engineering, and a catalog of twenty-three common patterns. The nice thing is, most experienced OOP designers will find out they've known about patterns all along. It's just that they've never considered them as such, or tried to centralize the idea behind a given pattern so that it will be easily reusable.
TL;DR: Examples of composite patterns are presented, a role-based analysis and composition technique is discussed, and it is demonstrated that composite patterns extend the pattern idea from single problem solutions to object-oriented frameworks.
Abstract: Software design patterns are the core abstractions from successful recurring problem solutions in software design. Composite design patterns are the core abstractions from successful recurring frameworks. A composite design pattern is a pattern that is best described as the composition of further patterns the integration of which shows a synergy that makes the composition more than just the sum of its parts. This paper presents examples of composite patterns, discusses a role-based analysis and composition technique, and demonstrates that composite patterns extend the pattern idea from single problem solutions to object-oriented frameworks.
TL;DR: This work identifies four problems associated with the implementation of design patterns using conventional object oriented languages and presents a solution to these problems in the context of the layered object model (LayOM).
Abstract: Design patterns are useful for the design of object oriented systems. The power of design patterns stems from their ability to provide generic solutions to reappearing problems that can be specialized for particular situations. The implementation of design patterns however, has received little attention. We identify four problems associated with their implementation using conventional object oriented languages. First, the traceability of a design pattern in the implementation is often insufficient; the design pattern is "lost". Second, because several patterns require an object to forward messages to other objects to increase flexibility, the self problem often occurs. Third, because the pattern implementation is mixed with the domain class, the reusability of pattern implementations is often limited. Finally, implementing design patterns may present significant implementation overhead for the software engineer. Often, a potentially large number of simple methods must be implemented with trivial behavior. A solution to these problems is presented in the context of the layered object model (LayOM). LayOM provides language support for the explicit representation of design patterns in the programming language. LayOM is an extended object oriented language which contains several components that are not part of the normal object model, such as states, categories and layers. Layers are used to represent design patterns at the level of the programming language. Example layer types for eight design patterns are presented. Because LayOM is an extensible language, the software engineer may extend the language model with abstractions for other design patterns
TL;DR: An analysis of Design Patterns is presented that will strongly reduce the number of Fundamental Design Patterns and show how strong language abstractions can solve the tracing problem and thereby enhance the documentation.
Abstract: The rapid evolution of Design Patterns has hampered the benefits gained from using Design Patterns. The increase in the number of Design Patterns makes a common vocabulary unmanageable, and the tracing problem obscures the documentation that should be enhanced by using Design Patterns. We present an analysis of Design Patterns that will strongly reduce the number of Fundamental Design Patterns and show how strong language abstractions can solve the tracing problem and thereby enhance the documentation.
TL;DR: This book will teach you the essential design patterns and how you can use them in your Java application and will show you where patterns are used in Java technology APIs and why they were used.
Abstract: From the Book:
PrefaceWhy We Wrote This Book
During the many Java programming language courses we teach, we have found that only a few programmers know what design patterns are when asked. About one in ten is able to name a few patterns off the top of his or her head. Of course, the concepts behind the patterns are familiar to many programmers. When we demonstrate patterns in the classroom, developers know and recognize them.
We decided to create a pattern catalog for the Java programming language developers who understand at a basic level why patterns are a good idea, and are interested in applying them, but want a practical, hands-on guide to just how and why to use each individual pattern. We've kept the book casual and frank in tone, and included full working Java code examples for each.
We will have succeeded when you complete this book having not only learned about design patterns and the Java programming language, but having had fun reading it, as well.
What This Book Is About
This book will teach you the essential design patterns and how you can use them in your Java application. Furthermore, this book will show you where patterns are used in Java technology APIs and why they were used.
Who Should Read This Book
This book is intended for experienced Java programmers who want to build better applications. You should be comfortable with the Java programming language and be familiar with most of the basic Java APIs. Some knowledge of UML is useful, but not required. We recommend UML Distilled by Martin Fowler as a UML reference.
How This Book Is Organized
This book is divided into two parts. Part I,"Commonly Used Patterns," is organized like a pattern catalogue, reference-style.
Chapter 1: "Creational Patterns" on page 3 discusses patterns that create objects: Abstract Factory, Builder, Factory Method, Prototype, and Singleton.
Chapter 2: "Behavioral Patterns" on page 39 is focussed on the patterns that can determine the behavior of your object model: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor.
Chapter 3: "Structural Patterns" on page 139 describes patterns that can bring structure to your application and has the following patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, HOPP, and Proxy.
Chapter 4: "System Patterns" on page 205 describes the patterns that help you build better architectures: Callback, Router, MVC, Session, Successive Update, Transaction, and Worker Thread.
Part II, "Patterns in the Java Programming Language," presents many of the Java APIs and shows the use of patterns in those API and their benefit.
Chapter 6: "Java Core APIs" on page 279 provides an overview in the familiar core APIs like Event Handling, JavaBeansTM, AWT and Swing, Collections, Input/Output, and Reflection.
Chapter 7: "Distributed Technologies" on page 303 describes selected distributed APIs and how patterns are used: JNDI, JDBC, RMI, and CORBA.
Chapter 8: "Jini and J2EE Architectures" on page 317 focuses on the two complementary frameworks Jini and J2EE. J2EE is further divided into Servlets, JSP and EJB technologies.
How to Use This Book
There are several ways to read this book. You could start at page one and read from cover to cover. However, we recommend you start with some of the easier patterns: Factory Method, Singleton, Observer, and Composite. Work your way through the book using those as starting points for your exploration. Alternatively, you might want to turn to sections in Part II first. Find an API you are familiar with and start looking for patterns there.
You can read the patterns in any order you feel most comfortable with. Later, you can use this book as a reference to refresh your memory when you want to put your knowledge of patterns into practice.
Companion Web Site
This book has a companion Web site to provide you with updates and other material: it is located at http://www.phptr.com/appliedjavapatterns