-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathThumbnails.tex
335 lines (231 loc) · 12.9 KB
/
Thumbnails.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
% $Author: oscar $
% $Date: 2009-09-15 16:53:48 +0200 (Tue, 15 Sep 2009) $
% $Revision: 29111 $
%=================================================================
\ifx\wholebook\relax\else
% --------------------------------------------
% Lulu:
\documentclass[a4paper,10pt,twoside]{book}
\usepackage[
papersize={6.13in,9.21in},
hmargin={.815in,.815in},
vmargin={.98in,.98in},
ignoreheadfoot
]{geometry}
\input{common.tex}
\pagestyle{headings}
\setboolean{lulu}{true}
% --------------------------------------------
% A4:
% \documentclass[a4paper,11pt,twoside]{book}
% \input{common.tex}
% \usepackage{a4wide}
% --------------------------------------------
\begin{document}
\appendix
\renewcommand{\nnbb}[2]{} % Disable editorial comments
\sloppy
\fi
%=================================================================
\chapter{Thumbnail patterns}
\chalabel{ThumbnailPatterns}
\on{Put these in the right places:}
\label{pat:Adapter}
\label{pat:Facade}
There are many patterns that are not specifically concerned with reengineering, but are still relevant to the reengineering process. In this chapter we have listed only those patterns that are specifically referred to at some point in this book. We have grouped them into the following three categories:
\index{DeLano, David}
\index{Rising, Linda}
\index{Binder, Robert}
\begin{bulletlist}
\item \emph{Testing patterns.}
These patterns help you to focus your testing efforts. Our principle source is a pattern language by DeLano and Rising \cite{DeLa98a}, though of course a vast literature is available on the subject. Binder, for example, devotes an entire book to the subject \cite{Bind99a}.
\index{Fowler, Martin}
\index{Roberts, Donald}
\item \emph{Refactoring patterns.}
These patterns focus on individual refactoring steps that you might applying during a reengineering project, or that you might just as well apply during any forward engineering project. Our principle sources are Fowler \etal \cite{Fowl99a}, and the Roberts' PhD thesis \cite{Robe99a}.
\item \emph{Design patterns.}
Very frequently the result of a reengineering operation is to put a particular design pattern into place. Here we remind the reader of some of the most common design patterns that pop up in a reengineering context. Our main source is, of course, the \emphind{Design Patterns} book \cite{Gamm95a}.
\end{bulletlist}
%=================================================================
%:SECTION Testing Patterns
\section{Testing Patterns}
%:THUMBNAIL -- {Retest Persistent Problems}
\thumbnail{Retest Persistent Problems}{RetestPersistentProblems}
\paragraph*{Problem:}
What areas of the system should receive concentrated testing, irrespective of the features being implemented?
\paragraph*{Solution:}
Keep a list of persistent problem areas and test cases to verify them, not just for resolving the current problems but also for use in subsequent testing. Test these areas thoroughly, even if there are no new features going into them. Retest regularly using, even one last time before the release goes out of the door.
\paragraph*{Source:}
Patterns for system testing \cite{DeLa98a}.
\paragraph*{Referenced from:}
\patpgref{Regression Test After Every Change}{RegressionTestAfterEveryChange}.
%:THUMBNAIL -- {Test Fuzzy Features}
\thumbnail{Test Fuzzy Features}{TestFuzzyFeatures}
\paragraph*{Problem:}
How can possible problem areas of the system be pinpointed so that the most problems can be found in the least amount of time?
\paragraph*{Solution:}
Study the documentation available on the system. Look for areas that seems ambiguous or ill-defined. Write test plans that cover these areas more thoroughly and concentrate testing in these areas. If designers can tell you all about a feature, it probably works. It's what they can't tell you that needs attention during testing.
\paragraph*{Source:}
Patterns for system testing \cite{DeLa98a}.
\paragraph*{Referenced from:}
\patpgref{Grow Your Test Base Incrementally}{GrowYourTestBaseIncrementally}.
%:THUMBNAIL -- {Test Old Bugs}
\thumbnail{Test Old Bugs}{TestOldBugs}
\paragraph*{Problem:}
What areas of the system should be targeted for testing so that the most problems can be found in the least amount of time?
\paragraph*{Solution:}
Examine problem reports from previous releases to help select test cases. Since it would be inefficient to test for all old problems, look at problems reported after the last valid snapshot of the system. Categorize problem reports to see if a trend is determined that could be used for additional testing.
\paragraph*{Source:}
Patterns for system testing \cite{DeLa98a}.
\paragraph*{Referenced from:}
\patpgref{Grow Your Test Base Incrementally}{GrowYourTestBaseIncrementally}.
%=================================================================
%:SECTION Refactorings
\section{Refactorings}
%:THUMBNAIL -- {Encapsulate Field}
\thumbnail{Encapsulate Field}{EncapsulateField}
\paragraph*{Also Known As:}
\ind{Abstract Instance Variable} \cite{Robe99a}.
\intent{There is a public field. Make it private and provide accessors.}
\paragraph*{Source:}
\emph{Refactoring: Improving the Design of Existing Code} \cite{Fowl99a}.
\paragraph*{Referenced from:}
\patpgref{Eliminate Navigation Code}{EliminateNavigationCode}.
%:THUMBNAIL -- {Extract Method}
\thumbnail{Extract Method}{ExtractMethod}
\intent{You have a code fragment that can be grouped together. Turn the fragment into a method whose name explains the purpose of the method.}
\paragraph*{Source:}
\emph{Refactoring: Improving the Design of Existing Code} \cite{Fowl99a}.
\paragraph*{Referenced from:}
\patpgref{Refactor to Understand}{RefactorToUnderstand}, \patpgref{Visualize Code as Dotplots}{VisualizeCodeAsDotplots}, \patpgref{Move Behavior Close to Data}{MoveBehaviorCloseToData}
%:THUMBNAIL -- {Move Method}
\thumbnail{Move Method}{MoveMethod}
\intent{A method is, or will be, using or used by more features of another class than the class on which it is defined. Create a new method with a similar body in the class it uses most. Either turn the old method into a simple delegation, or remove it altogether.}
\paragraph*{Source:}
\emph{Refactoring: Improving the Design of Existing Code} \cite{Fowl99a}.
\paragraph*{Referenced from:}
\patpgref{Refactor to Understand}{RefactorToUnderstand}, \patpgref{Move Behavior Close to Data}{MoveBehaviorCloseToData}
%:THUMBNAIL -- {Rename Attribute}
\thumbnail{Rename Attribute}{RenameAttribute}
\intent{Rename an instance variable and update all references to it.}
\paragraph*{Source:}
\emph{Practical Analysis for Refactoring} \cite{Robe99a}.
\paragraph*{Referenced from:}
\patpgref{Refactor to Understand}{RefactorToUnderstand}.
%:THUMBNAIL -- {Rename Method}
\thumbnail{Rename Method}{RenameMethod}
\intent{The name of a method does not reveal its purpose. Change the name of the method.}
\paragraph*{Source:}
\emph{Refactoring: Improving the Design of Existing Code} \cite{Fowl99a}.
\paragraph*{Referenced from:}
\patpgref{Refactor to Understand}{RefactorToUnderstand}
%:THUMBNAIL -- {Replace Conditional with Polymorphism}
\thumbnail{Replace Conditional with Polymorphism}{ReplaceConditionalWithPolymorphism}
\intent{You have a conditional that chooses different behavior depending on the type of an object. Move each leg of the conditional to an overriding method in a subclass. Make the original method abstract.}
\paragraph*{Source:}
\emph{Refactoring: Improving the Design of Existing Code} \cite{Fowl99a}.
\paragraph*{Referenced from:}
\patpgref{Transform Client Type Checks}{TransformClientTypeChecks}
%=================================================================
\section{Design Patterns}
%:THUMBNAIL -- {Abstract Factory}
\thumbnail{Abstract Factory}{AbstractFactory}
\intent{Provide an interface for creating families of related or dependent objects without specifying their concrete classes.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Look for the Contracts}{LookForTheContracts}, \patpgref{Transform Client Type Checks}{TransformClientTypeChecks}.
%:THUMBNAIL -- {Adapter}
\thumbnail{Adapter}{Adapter}
\intent{Convert the interface of a class into another interface clients expect. \patref{Adapter}{Adapter} lets classes work together that couldn't otherwise because of incompatible interfaces.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Present the Right Interface}{PresentTheRightInterface}, \patpgref{Move Behavior Close to Data}{MoveBehaviorCloseToData}.
%:THUMBNAIL -- {Facade}
\thumbnail{Facade}{Facade}
\intent{Provide a unified interface to a set of interfaces in a subsystem. \patref{Facade}{Facade} defines a higher-level interface that makes the subsystem easier to use.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Eliminate Navigation Code}{EliminateNavigationCode}, \patpgref{Split Up God Class}{SplitUpGodClass}.
%:THUMBNAIL -- {Factory Method}
\thumbnail{Factory Method}{FactoryMethod}
\intent{Define an interface for creating an object, but let subclasses decide which class to instantiate. \patref{Factory Method}{FactoryMethod} lets a class defer instantiation to subclasses.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Look for the Contracts}{LookForTheContracts}
%:THUMBNAIL -- {Flyweight}
\thumbnail{Flyweight}{Flyweight}
\intent{Use sharing to support large numbers of fine-grained objects efficiently.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Speculate about Design}{SpeculateAboutDesign}
%:THUMBNAIL -- {Null Object}
\thumbnail{Null Object}{NullObject}
\intent{A \patref{Null Object}{NullObject} provides a surrogate for another object that shares the same interface but does nothing. Thus, the \patref{Null Object}{NullObject} encapsulates the implementation decisions of how to do nothing and hides those details from its collaborators}
\paragraph*{Source:}
\emph{Null Object} \cite{Wool98a}.
\paragraph*{Referenced from:}
\patpgref{Introduce Null Object}{IntroduceNullObject}.
%:THUMBNAIL -- {Quantity}
\thumbnail{Quantity}{Quantity}
\paragraph*{Problem:}
Representing a value such as 6 feet or \$5.
\paragraph*{Solution:}
Use a quantity type that includes both the amount and the unit. Currencies are a kind of unit.
\paragraph*{Source:}
\emph{Analysis Patterns: Reusable Objects Models} \cite{Fowl97b}.
\paragraph*{Referenced from:}
\patpgref{Analyze the Persistent Data}{AnalyzeThePersistentData}.
%:THUMBNAIL -- {Singleton}
\thumbnail{Singleton}{Singleton}
\intent{Ensure a class only has one instance, and provide a global point of access to it.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Read all the Code in One Hour}{ReadAllTheCodeInOneHour}.
%:THUMBNAIL -- {State}
\thumbnail{State}{State}
\intent{Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. }
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Factor out State}{FactorOutState}.
%:THUMBNAIL -- {State Patterns}
\thumblang{State Patterns}{StatePatterns}
\intent{The \patref{State}{State} Patterns pattern language refines and clarifies the \patref{State}{State} Pattern.}
\paragraph*{Source:}
\emph{State Patterns} \cite{Dyso97a}.
\paragraph*{Referenced from:}
\patpgref{Factor out State}{FactorOutState}.
%:THUMBNAIL -- {Strategy}
\thumbnail{Strategy}{Strategy}
\intent{Define a family of algorithms, encapsulate each one in a separate class, and define each class with the same interface so they can be interchangeable. \patref{Strategy}{Strategy} lets the algorithm vary independently from clients that use it. }
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Factor out Strategy}{FactorOutStrategy}.
%:THUMBNAIL -- {Template Method}
\thumbnail{Template Method}{TemplateMethod}
\intent{Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. \patref{Template Method}{TemplateMethod} lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Look for the Contracts}{LookForTheContracts}.
%:THUMBNAIL -- {Visitor}
\thumbnail{Visitor}{Visitor}
\intent{Represent an operation to be performed on the elements of an object structure. \patref{Visitor}{Visitor} lets you define a new operation without changing the classes of the elements on which it operates.}
\paragraph*{Source:}
\emph{Design Patterns} \cite{Gamm95a}.
\paragraph*{Referenced from:}
\patpgref{Move Behavior Close to Data}{MoveBehaviorCloseToData}.
%=============================================================
\ifx\wholebook\relax\else
\bibliographystyle{alpha}
\bibliography{scg}
\end{document}
\fi
%=============================================================