Design Patterns in Java

David Wallace Croft
croft@alumni.caltech.edu

2000-08-22

Inspired by the classic Computer Science text
Design Patterns: Elements of Reusable Object-Oriented Software
1995; Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides

All of the source code below has been successfully compiled.


Observer

BroadcastListener.java
Broadcaster.java
BroadcastEvent.java
Broadcast.java

Singleton

Singleton.java
LazySingleton.java
RegistrySingleton.java


Waiter

1998-04-07

A Waiter relays an order Object to a Producer, waits in an independent thread during the production, and then delivers the result using a Consumer callback method.

Waiter.java
Producer.java
Consumer.java

Conservator

1998-04-19

Conservator extends on the concept of a Flyweight Factory by allowing shared Flyweight objects to be mutated after creation without undesired side effects.

Conservator.java
Intrinsic.java
Extrinsic.java
Flyweight.java
Heavyweight.java


Resources


Additional design pattern examples will be forthcoming.
Enter your e-mail address to receive e-mail when this page is updated.

Back

http://www.alumni.caltech.edu/~croft/research/java/pattern/
David Wallace Croft, croft@alumni.caltech.edu
Posted 1998-04-06.