Home Page Icon
Home Page
Table of Contents for
Titlepage
Close
Titlepage
by Allen Holub
Holub on Patterns: Learning Design Patterns by Looking at Code
Coverpage
Titlepage
Copyright
Dedication
Contents
About the Author
Acknowledgments
Preface
CHAPTER 1 Preliminaries: OO and Design Patterns
Patterns vs. Idioms
So What Is a Design Pattern, Anyway?
So, What’s It All Good For?
The Role of Patterns in Design
The Tension Between Patterns and Simplicity
Classifying Patterns
On Design, Generally
Programming FORTRAN in Java
Programming with Your Eyes Open
What Is an Object?
Balderdash!
An Object Is a Bundle of Capabilities
How Do You Do It Wrong?
So How Do You Do It “Right?”
Cellular Automata
Getters and Setters Are Evil
Render Thyself
JavaBeans and Struts
Refactoring
Life Without Get/Set
When Are Accessors and Mutators Okay?
Summing Up the Getter/Setter Issues
CHAPTER 2 Programming with Interfaces, and a Few Creational Patterns
Why extends Is Evil
Interfaces vs. Classes
Losing Flexibility
Coupling
The Fragile-Base-Class Problem
Multiple Inheritance
Frameworks and the Template-Method and Factory-Method Patterns
Summing Up Fragile Base Classes
When extends Is Appropriate
Getting Rid of extends
Factories and Singletons
Singleton
Threading Issues in Singleton
Double-Checked Locking (Don’t Do It)
Killing a Singleton
Abstract Factory
Pattern Stew
Dynamic Creation in a Factory
Command and Strategy
Summing Up
CHAPTER 3 The Game of Life
Get a Life
Charting the Structure of Life
The Clock Subsystem: Observer
Implementing Observer: The Publisher Class
The Clock Subsystem: The Visitor Pattern
The Menuing Subsystem: Composite
The Menuing Subsystem: Facade and Bridge
The MenuSite
The Core Classes
The Universe Class
The Cell Interface
The Resident Class
The Neighborhood Class
Mediator
Composite Revisited
Prototype
Composite Redux
Flyweight
Flyweight Pools
Memento
Loose Ends
Summing Up
CHAPTER 4 Implementing Embedded SQL
The Requirements
The Architecture
The Data-Storage Layer
The Table Interface
The Bridge Pattern
Creating a Table, Abstract Factory
Creating and Saving a Table: Passive Iterators and Builder
Populating the Table
Examining a Table: The Iterator Pattern
Implementing Transactions (Undo) with the Command Pattern
Modifying a Table: The Strategy Pattern
Selection and Joins
Miscellany
Variants on the Table: The Decorator Pattern
Adding SQL to the Mix
SQL-Engine Structure
Input Tokenization, Flyweight Revisited, and Chain of Responsibility
The Scanner: Chain of Responsibility
The ParseFailure Class
The Database Class
Using the Database
The Proxy Pattern
The Token Set and Other Constants
The Interpreter Pattern
Supported SQL
Watching the Interpreter in Action
The JDBC Layer
The State Pattern and JDBCConnection
Statements
The Adapter Pattern (Result Sets)
Finishing Up the Code
When Bridges Fail
Whew!
APPENDIX A Design-Pattern Quick Reference
Creational Patterns
Abstract Factory
Builder
Factory Method
Prototype
Singleton
Structural Patterns
Adapter
Bridge
Composite
Decorator
Facade
Flyweight
Proxy
Behavioral Patterns
Chain of Responsibility
Command
Interpreter
Iterator
Mediator
Memento
Observer (Publish/Subscribe)
State
Strategy
Template Method
Visitor
INDEX
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Coverpage
Next
Next Chapter
Copyright
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset