Design Patterns Java™ Workbook
Chapter 1. Introduction To Patterns The Organization of This Book............................................................... ...
Chapter 1. Introduction To Patterns Welcome to Oozinoz!......................................................................... ...
Part I: Interface Patterns.......................................................................................... Part I: Int ...
Chapter 2. Introducing Interfaces............................................................................................... ...
Chapter 2. Introducing Interfaces package com.oozinoz.simulation; import com.oozinoz.units.*; interface RocketSim { abstract Len ...
Chapter 2. Introducing Interfaces CHALLENGE 2.3 Give an example of an interface with methods that do not imply responsibility on ...
Chapter 2. Introducing Interfaces Consider the definition of the classification of fireworks. In the United States, federal law ...
Chapter 2. Introducing Interfaces public void secureOrder(Firework_1 f /, etc. /) { //... if (f.classification == Classification ...
Chapter 2. Introducing Interfaces CHALLENGE 2.5 How can you change the secureOrder()method and its class to take advantage of th ...
Chapter 3. Adapter.............................................................................................................. ...
Chapter 3. Adapter Figure 3.1. When a developer of client code thoughtfully defines the client's needs, your mission is to adapt ...
Chapter 3. Adapter CHALLENGE 3.1 Complete the class diagram in Figure 3.2 to show the design of a ShellAsRocket class that lets ...
Chapter 3. Adapter Figure 3.3. Oozinoz models units as instances of the Measure class, whose subclasses represent particular phy ...
Chapter 3. Adapter public static void showVolume(Volume v) { System.out.println("I see "); System.out.println( "\t" + v.divide(G ...
Chapter 3. Adapter Figure 3.4. The JTable class is a Swing component that lifts data from an implementation of TableModel into a ...
Chapter 3. Adapter Figure 3.5. The AbstractTableModel class provides defaults for all but a few of the methods in TableModel. Su ...
Chapter 3. Adapter Figure 3.6. The RocketTable class adapts the TableModel interface to the Rocket class from the Oozinoz domain ...
Chapter 3. Adapter public RocketTable(Rocket[] rockets) { this.rockets = rockets; } public int getColumnCount() { // challenge! ...
Chapter 3. Adapter package com.oozinoz.applications; import java.awt.; import javax.swing.; import java.awt.event.; import com.o ...
Chapter 3. Adapter public static void display(Component c, String title) { JFrame f = new JFrame(title); f.getContentPane().add( ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf