Full HTML for

Basic foilset Design Patterns: What's in it for you?

Given by Konrad Olszewski at Tango Group Internal Technology Seminars on Spring 99. Foils prepared May 19 99
Outside Index Summary of Material


Rationale
Swing architecture
Observer
Factory
Template
Command
Summary

Table of Contents for full HTML of Design Patterns: What's in it for you?

Denote Foils where Image Critical
Denote Foils where HTML is sufficient

1 Design Patterns What's In There for You?
2 Outline
3 Rationale
4 What Is a Design Pattern?
5 MVC Architecture
6 MVC Architecture
7 Swing Architecture
8 Observer Pattern
9 Observer Pattern
10 Observer in Java
11 Swing JList
12 How to Construct a Model?
13 Tango Example
14 Factory Pattern
15 Factory Pattern
16 Tango Example
17 Template Pattern
18 Template Pattern
19 Tango Example
20 Command Pattern
21 Command Pattern
22 Tango Example
23 Summary
24 Literature

Outside Index Summary of Material



HTML version of Basic Foils prepared May 19 99

Foil 1 Design Patterns What's In There for You?

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Konrad Olszewski
Syracuse 1999

HTML version of Basic Foils prepared May 19 99

Foil 2 Outline

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Rationale
Swing architecture
Observer
Factory
Template
Command
Summary

HTML version of Basic Foils prepared May 19 99

Foil 3 Rationale

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
"Once you understand the design patterns and have had an `Aha!' (and not just `Huh?') experience with them, you won't ever think about object-oriented design in the same way."
Gamma et al

HTML version of Basic Foils prepared May 19 99

Foil 4 What Is a Design Pattern?

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
A pattern describes a reoccurring problem and provides a customizable solution to that problem.
Design patterns locate themselves between simple algorithms and data structure (e.g. linked lists) and application designs.

HTML version of Basic Foils prepared May 19 99

Foil 5 MVC Architecture

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Model - holds the information about component state
Controller - receives and responds to input
View - displays the component

HTML version of Basic Foils prepared May 19 99

Foil 6 MVC Architecture

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
notifications
Data to screen
Application code
notifications
Mouse, focus, keyboard, etc.

HTML version of Basic Foils prepared May 19 99

Foil 7 Swing Architecture

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Main components (e.g. JList, JButton, etc.) are wrappers hiding the internal complexity
View and controller are usually integrated into one class (usually with suffix UI, eg. BasicButtonUI)
components that are containers may use custom renderers to display their data (e.g. DefaultListCellRenderer)

HTML version of Basic Foils prepared May 19 99

Foil 8 Observer Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Defines a one-to-many dependency between the objects so that when one object changes state, all its dependents are notified and updated automatiacally

HTML version of Basic Foils prepared May 19 99

Foil 9 Observer Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
observers
subject

HTML version of Basic Foils prepared May 19 99

Foil 10 Observer in Java

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
All the listeners are observers

HTML version of Basic Foils prepared May 19 99

Foil 11 Swing JList

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Can be initialized with either simple data (array, Vector) or a ListModel
ListModel makes association between model and view and takes care of notifications

HTML version of Basic Foils prepared May 19 99

Foil 12 How to Construct a Model?

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Swing provides a following hierarchy:
  • ListModel (interface, defines data access methods)
  • AbstractListModel (abstract class, handles connections and notifications to the view )
  • DefaultListModel (implements data store using Vector; this class is ready to use)

HTML version of Basic Foils prepared May 19 99

Foil 13 Tango Example

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
TAgent
TControlListener
DefaultListModel
UserListModel
JList
UserRenderer

HTML version of Basic Foils prepared May 19 99

Foil 14 Factory Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Provides an interface for creating objects without specifying their concrete classes
Hides the complexity of objects
Example: creation of different GUI elements in Swing (each element is represented by different class depending on the Look-and-Feel)

HTML version of Basic Foils prepared May 19 99

Foil 15 Factory Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Factory
createProduct()
Client
ConcreteProduct1
ConcreteProduct2
AbstractProduct

HTML version of Basic Foils prepared May 19 99

Foil 16 Tango Example

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
SessionFactory
createSession(AT)
SessionStore
StandardSession
BVSession
Session

HTML version of Basic Foils prepared May 19 99

Foil 17 Template Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Template lets its subclasses redefine some parts of behavior without changing the class structure.
Very often used!!!

HTML version of Basic Foils prepared May 19 99

Foil 18 Template Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
AbstractClass
template()
operation1()
operation2()
operation1();
operation2();

HTML version of Basic Foils prepared May 19 99

Foil 19 Tango Example

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
AudioProvider
run()
getData()
decodeData()
pushData()
HTTPProvider
FileProvider
FTPProvider
getData();
decodeData();
pushData();

HTML version of Basic Foils prepared May 19 99

Foil 20 Command Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Command encapsulates a request as an object
Command decouples the object that invokes the operation from the one that knows how to perform it

HTML version of Basic Foils prepared May 19 99

Foil 21 Command Pattern

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Client
Invoker

HTML version of Basic Foils prepared May 19 99

Foil 22 Tango Example

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
TAgent
TDataListener
MessageReceiver
Message
execute()

HTML version of Basic Foils prepared May 19 99

Foil 23 Summary

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Design Patterns characteristics:
  • speed up software design
  • promote good programming style by enforcing designs
  • bring profits in the long run by easier code maintenance and reusability
  • are not trivial to use

HTML version of Basic Foils prepared May 19 99

Foil 24 Literature

From Design Patterns: What's in it for you? Tango Group Internal Technology Seminars -- Spring 99. *
Full HTML Index
Design Patterns. Elements of Reusable Object-Oriented Software by E. Gamma, R. Helm, R. Johnson and J. Vlissides
Core Java Foundation Classes by Kim Topley

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed May 19 1999