Logo GenDocs.ru

Поиск по сайту:  

Загрузка...

Bruce Eckel's. Thinking in Patterns 2004 - файл TIPatterns.htm


Bruce Eckel's. Thinking in Patterns 2004
скачать (308.9 kb.)

Доступные файлы (174):

AdapterVariations.java
build.xml
makefile
SimpleAdapter.java
BridgeStructure.java
build.xml
makefile
BuildMedia.java
build.xml
makefile
build.xml
build.xml
FindMinima.java
makefile
CheckVersion.java
makefile
Arrays2.java
BooleanGenerator.java
ByteGenerator.java
CharGenerator.java
DoubleGenerator.java
FloatGenerator.java
Generator.java
IntGenerator.java
LongGenerator.java
makefile
ShortGenerator.java
StringList.java
TypedIterator.java
build.xml
build.xml
CommandPattern.java
makefile
build.xml
CompositeStructure.java
makefile
CoffeeShop2.java
makefile
build.xml
CoffeeShop3.java
makefile
CoffeeShop.java
makefile
build.xml
Facade.java
makefile
build.xml
Games.java
makefile
makefile
ShapeFactory1.java
makefile
ShapeFactory2.java
flagInfo.txt1kb.20.05.2003 14:40скачать
build.xml
FlyWeightObjects.java
makefile
ManyObjects.java
makefile
Schedule.ghs
javac.mac
jikes.mac
JUnitTestAll.java
makefile
build.xml
makefile
PaperScissorsRock.java
BoxObserver.java
build.xml
makefile
ObservedFlower.java
Amaze.txt1kb.20.05.2003 14:40скачать
build.xml
makefile
Maze.java
Rat.java
build.xml
ConnectionPoolProxyDemo.java
makefile
PoolManager.java
ProxyDemo.java
build.xml
DDAluminum.java
DDCardboard.java
DDGlass.java
DDPaper.java
DDTrash.dat
DoubleDispatch.java
makefile
TypedBin.java
TypedBinMember.java
DynaTrash.java
makefile
makefile
RecycleA.java
makefile
RecycleAP.java
makefile
RecycleB.java
Aluminum.java
Cardboard.java
FillableCollection.java
Fillable.java
Glass.java
makefile
Paper.java
ParseTrash.java
Trash.dat
Trash.java
FillableVisitor.java
makefile
TrashVisitor.java
VAluminum.java
VisitableDecorator.java
Visitable.java
Visitor.java
build.xml
CollectingParameterDemo.java
makefile
MessengerDemo.java
build.xml
ConnectionPoolDemo.java
makefile
PoolManager.java
SingletonPattern.java
build.xml
KissingPrincess2.java
KissingPrincess.java
makefile
StateDemo.java
build.xml
Input.java
makefile
makefile
MouseAction.java
MouseMoveList.java
MouseMoves.txt1kb.20.05.2003 14:40скачать
makefile
MouseTrapTest.java
makefile
MouseTrap2Test.java
State.java
StateMachine.java
makefile
VendingMachine.java
VendingMachineTest.java
build.xml
Condition.java
Input.java
makefile
State.java
StateMachine.java
Transition.java
build.xml
makefile
StrategyPattern.java
build.xml
makefile
TemplateMethod.java
BeeAndFlowers.java
build.xml
makefile
image001.gif2kb.20.05.2003 14:53скачать
image002.gif4kb.20.05.2003 14:53скачать
image003.gif5kb.20.05.2003 14:53скачать
image004.gif2kb.20.05.2003 14:53скачать
image005.gif3kb.20.05.2003 14:53скачать
image006.gif18kb.20.05.2003 14:53скачать
image007.gif6kb.20.05.2003 14:53скачать
image008.gif2kb.20.05.2003 14:53скачать
image009.gif3kb.20.05.2003 14:53скачать
image010.gif4kb.20.05.2003 14:53скачать
image011.gif8kb.20.05.2003 14:53скачать
TIPatterns.htm770kb.20.05.2003 14:53скачать

содержание

TIPatterns.htm

  1   2   3   4   5   6   7   8   9   ...   29
Thinking in Patterns by Bruce Eckel
Revision 0.9, 5-20-2003 (This version contains the material that will be used in the Crested Butte seminar; see http://www.mindview.net/Seminars/ThinkingInPatterns/)
Please note this document is under development and incomplete. Updates to this document can be found at http://www.Mindview.net

Best viewed with Mozilla! (free at www.Mozilla.org) (Even though this document was created with MS Word, IE6 garbles lines with superscripts on them. Mozilla seems to do a much better job).

___________________________________________

Note: This document requires the installation of the fonts Georgia, Verdana and Andale Mono (code font) for proper viewing. These can be found at: http://sourceforge.net/project/showfiles.php?group_id=34153&release_id=105355

Modifications in Revision 0.9:

·         Prose has still had little/no work. My current goal is to get the structure and examples worked out so that the seminar works well. Once it has been proven in the seminars, then I will spend time on the prose.

·         Added proxy:PoolManager.java to make a more generic/customizeable Pool Manager, and modified proxy:ConnectionPoolProxyDemo.java accordingly [[ Still need to decide what to return when you run out of objects in the pool ]]

·         Changed PoolManager.java to use an ArrayList (and thus does not require a fixed size at initialization)

·         Added KissingPrincess.java to State description, as a motivational example for the pattern

·         Added a simple Flyweight example

·         Simplified the enumeration in PaperScissorsRock.java

Modifications in Revision 0.8:

·         Changed Bridge example to improve clarity.

·         Removed superscripts for better viewing with IE (see note above)

Modifications in Revision 0.7:

·         ^ NOTE primary changes have been made to structure of book and code examples, but not to prose. Prose can be considered to be mostly a mess in this revision.

·         Complete reorganization under headings that attempt to describe the problems you are trying to solve with a pattern.

·         Addition of placeholders for the remainder of the GoF patterns

·         Addition of “Simplifying Idioms” section and examples

·         Addition of Builder section and examples

·         Removed unit-testing chapter; replaced with reference to “new” JUnit (which uses reflection)

·         (4-30-2003) Added Ant build.xml files, and support files from TIJ necessary to do a full standalone build. You should be able to type “ant” from the code root directory and get a successful build.

·         Dramatically simplified chainofresponsibility:FindMinima.java

·         Added object pool/connection pool examples

·         Refactored small things in many examples

·         Some exercises may have been left behind when patterns were moved.

·         For simplicity, saved from Word into a single HTML document, using “filtered” version to remove Office stuff. Seems to work pretty well; checked it with both IE and Mozilla (actually seems to work better on Mozilla than on IE!).

TODO:

·         Reconfigure for new backtalk system

·         Replace references to TIJ2 with TIJ3


Thinking

in

Patterns

Problem-Solving  Techniques using Java

Bruce Eckel

President, MindView, Inc.

#[BT_1]#


Contents

Preface  8

Introduction  11

The Y2K syndrome. 11

Context and composition. 12

A word about checked exceptions  13

The pattern concept 15

What is a pattern?. 15

Pattern taxonomy. 17

Design principles. 18

Classifying patterns. 19

The development challenge. 21

Unit testing. 21

Location of test code. 22

Simplifying Idioms  22

Messenger. 22

Collecting Parameter. 24

Object quantity  25

Singleton. 25

Exercises. 27

Object pool 27

Exercises. 30

Object decoupling  30

Proxy: fronting for another object 31

The PoolManager using Proxy. 33

Dynamic Proxies. 36

State: changing object behavior  38

Iterators: decoupling algorithms from containers  44

Type-safe iterators. 45

Exercises. 46

Factoring commonality  47

Strategy: choosing the algorithm at run-time  48

Policy: generalized strategy. 50

Template method. 50

Exercises. 52

Encapsulating creation  52

Simple Factory method. 53

Polymorphic factories. 55

Abstract factories. 58

Exercises. 61

Specialized creation  61

Prototype. 61

Builder. 62

Exercises. 66

Too many  66

Flyweight: too many objects. 66

Decorator: too many classes. 69

Basic decorator structure. 70

A coffee example. 70

Class for each combination. 70

The decorator approach. 73

Compromise. 78

Other considerations. 82

Exercises. 83

Connecting different types  84

Adapter. 84

Bridge. 87

Exercises. 93

Flexible structure  93

Composite. 93

System decoupling  95

Observer. 95

Observing flowers. 97

A visual example of observers. 101

Mediator. 103

Exercises. 104

Reducing interface complexity  104

Façade. 105

Package as a variation of Façade  106

Algorithmic partitioning  106

Command: choosing the operation at run-time  106

Exercises. 109

Chain of responsibility. 109

Exercises. 112

Externalizing object state  113

Memento. 113

Complex interactions  114

Multiple dispatching. 114

Visitor, a type of multiple dispatching  117

Exercises. 119

Multiple languages  120

Interpreter motivation. 121

Python overview.. 122

Built-in containers. 123

Functions. 124

Strings. 125

Classes. 127

Creating a language. 130

Controlling the interpreter. 134

Putting data in. 134

Getting data out. 140

Multiple interpreters. 143

Controlling Java from Jython  144

Inner Classes. 148

Using Java libraries. 148

Inheriting from Java library classes  150

Creating Java classes with Jython  151

Building the Java classes from the Python code  156

The Java-Python Extension (JPE)  157

Summary. 157

Exercises. 158

Complex system states  159

StateMachine. 159

Exercises. 169

Table-Driven State Machine. 169

The State class. 171

Conditions for transition. 172

Transition actions. 172

The table. 172

The basic machine. 173

Simple vending machine. 174

Testing the machine. 179

Tools. 180

Table-driven code: configuration flexibility  180

Table-driven code using anonymous inner classes  180

Exercises. 180

Pattern refactoring  181

Simulating the trash recycler. 182

Improving the design. 186

“Make more objects”. 186

A pattern for prototyping creation  189

^ Trash subclasses. 193

Parsing Trash from an external file  195

Recycling with prototyping. 198

Abstracting usage. 199

Multiple dispatching. 203

Implementing the double dispatch   204

The Visitor pattern. 211

A Reflective Decorator. 214

More coupling?. 219

RTTI considered harmful?. 220

Summary. 223

Exercises. 224

Projects  225

Rats & Mazes. 225

Other maze resources. 230

XML Decorator. 230

A: Tools  230

Ant extensions. 231

Array utilities. 232



  1   2   3   4   5   6   7   8   9   ...   29



Скачать файл (308.9 kb.)

Поиск по сайту:  

© gendocs.ru
При копировании укажите ссылку.
обратиться к администрации