................ 869
Building with Ant ............966
The clipboard ............................. 872
Packaging an applet into a
Automate everything ..................966
JAR file ............................875
Problems with make .................967
Signing applets ................876
Ant: the defacto standard.......... 968
JNLP and Java Web Start881
Version control with CVS ...........973
Programming techniques887
Daily builds.................................976
Logging ............................ 977
Binding events dynamically.......888
Logging Levels ............................979
Separating business logic from UI
LogRecords .................................982
logic ............................................890
Handlers .................................... 984
A canonical form ........................ 893
Concurrency & Swing......893
Filters......................................... 989
Formatters...................................991
Strategies for transition 1044
Example: Sending email to report
Guidelines.................................1044
log messages............................... 992
Management obstacles .............1046
Controlling Logging Levels through
Summary .......................1048
Namespaces ............................... 995
A: Passing & Returning
Logging Practices for Large Projects997 Objects 1049
Summary...................................1001
Debugging...................... 1001
Passing references around1050
Aliasing ..................................... 1051
Debugging with JDB ................ 1002
Making local copies ....... 1053
Graphical debuggers ................ 1008
Profiling and optimizing1008
Pass by value............................. 1054
Cloning objects ......................... 1055
Tracking memory consumption1009
Adding cloneability to a class ... 1056
Tracking CPU usage................. 1009
Successful cloning .................... 1059
Coverage testing........................1010
The effect of Object.clone( ) . 1061
JVM Profiling Interface ............1010
Cloning a composed object.......1063
Using HPROF............................ 1011
A deep copy with ArrayList ...1066
Thread performance .................1013
Deep copy via serialization.......1068
Optimization guidelines............1014
Doclets ........................... 1015
Adding cloneability further down a
Summary ....................... 1018
hierarchy....................................1071
Exercises........................1020
Why this strange design? ......... 1072
Controlling cloneability. 1073
16: Analysis and design 1023
The copy constructor................ 1078
Methodology..................1023
Read-only classes ..........1084
Phase 0: Make a plan ....1026
Creating read-only classes........1086
The mission statement............. 1026
The drawback to immutability . 1087
Phase 1: What are we
Immutable Strings..................1089
making? ......................... 1027
The String and StringBuffer
Phase 2: How will we build
classes .......................................1093
it? ................................... 1031
Strings are special................... 1097
Five stages of object design...... 1034
Summary .......................1098
Guidelines for object development1035
Exercises ........................1099
Phase 3: Build the core..1036
B: Java Programming
Phase 4: Iterate the use cases1037
Phase 5: Evolution.........1038
Guidelines 1101
Plans pay off ..................1040
Design .............................1101
Extreme programming..1040
Implementation............. 1108
Write tests first..........................1041
Pair programming.................... 1043
C: Supplements
1117
Thinking in Patterns
Foundations for Java
Seminar........................... 1119
seminar-on-CD............... 1117
Design Consulting, Reviews
Hands-On Java seminar-on-
and Walkthroughs.......... 1119
CD 3rd edition .................1118
D: Resources
1121
Thinking in Java Seminar1118
Software.......................... 1121
Thinking in Enterprise Java1118
Books .............................. 1121
Designing Objects & Systems
Analysis & design.......................1122
Seminar .......................... 1119
Python........................................1125
Thinking in Patterns with
My own list of books..................1126
Java................................. 1119
Index 1129
Preface
I suggested to my brother Todd, who is making the leap
from hardware into programming, that the next big
revolution will be in genetic engineering.
We’ll have microbes designed to make food, fuel, and plastic; they’ll clean
up pollution and in general allow us to master the manipulation of the
physical world for a fraction of what it costs now. I claimed that it would
make the computer revolution look small in comparison. Feedback
Then I realized I was making a mistake common to science fiction writers:
getting lost in the technology (which is of course easy to do in science