• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
1 z 157
Thinking in Patterns by Bruce EckelRevision 0.9, 5-20-2003 (This version contains the material that willbe 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 athttp://www.Mindview.net Best viewed with Mozilla! (free atwww.Mozilla.org) (Even though thisdocument was created with MS Word, IE6 garbles lines withsuperscripts on them. Mozilla seems to do a much better job).
 ___________________________________________Note
: This document requires the installation of the fonts Georgia, Verdana and AndaleMono (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 todecide 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 sizeat initialization)
 
 Added KissingPrincess.java to State description, as a motivational example for thepattern
 
 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 codeexamples, but not to prose. Prose can be considered to be mostly a mess inthis revision.
 
Complete reorganization under headings that attempt to describe the problems youare 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 usesreflection)
 
(4-30-2003) Added Ant build.xml files, and support files from TIJ necessary to do afull standalone build. You should be able to type “ant” from the code root directory 
 
2 z 157
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 andMozilla (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 Techniquesusing Java
Bruce Eckel
President, MindView, Inc.
Contents
Preface
 
3 z 157
Introduction
The Y2K syndromeContext and composition A word about checked exceptions
The pattern concept
 What is a pattern?Pattern taxonomy Design principlesClassifying patternsThe development challengeUnit testing
Location of test code
Simplifying Idioms
MessengerCollecting Parameter
Object quantity 
Singleton
Exercises
Object pool
Exercises
Object decoupling
Proxy: fronting for another object
The PoolManager using Proxy Dynamic Proxies
State: changing object behaviorIterators: decoupling algorithms from containers
Type-safe iterators
Exercises
Factoring commonality 
Strategy: choosing the algorithm at run-timePolicy: generalized strategy Template method
Exercises
Encapsulating creation
Simple Factory methodPolymorphic factories Abstract factoriesExercises
Specialized creation
PrototypeBuilderExercises
Too many 
Flyweight: too many objectsDecorator: too many classes
Basic decorator structure A coffee exampleClass for each combinationThe decorator approachCompromiseOther considerationsExercises
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...