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
|
<head>
<style>
<!--
table.MsoNormalTable
{mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";
}
-->
</style>
<STYLE TYPE="text/css">
<!--
/* FOR THE SDA PAGE */
/*
BODY {margin-top: 15px; margin-left: 15px; margin-right: 15px;}
*/
A:link {
color:#4756AC;
}
A:visited {
color:#60657B;
}
A:hover {
color:red
}
INPUT {font:12px "Courier New", sans-serif;}
H2 {
font:18px/18px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:110%;
}
H3 {
font:18px/18px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:110%;
}
H4 {
font:15px/16px Verdana, Arial, Helvetica, sans-serif;
color:black;
font-weight:bold;
margin-left: 10px;
line-height:140%;
}
P {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
.paragraph {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
.smallParagraph {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
margin-right: 10px;
margin-left: 10px;
line-height:130%;
}
LI {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}
/*
UL {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}*/
DL {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
margin-right: 10px;
margin-left: 15px;
line-height:120%;
}
B { font:13px/13px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:140%;
}
.footer {
font:10px/10px Verdana, Arial, Helvetica, sans-serif;
color:#888888;
text-align:left
}
.figureTitle {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
text-align:justify;
text-align:center
}
.copyrightNotice {
font:10px/10px Verdana, Arial, Helvetica, sans-serif;
color:#999999;
line-height:110%;
}
.smallHeading {
font:13px/13px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:110%;
}
.tinyHeading {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
line-height:120%;
}
.newsText {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
line-height:130%;
}
.smallParagraph {
font:11px/11px Verdana, Arial, Helvetica, sans-serif;
line-height:130%;
}
.fancyHeading {
font:20px/20px Chantilly, Arial, Helvetica, sans-serif;
margin-right: 10px;
color:#6f7a92;
margin-left: 10px;
line-height:130%;
}
-->
</STYLE>
</head>
<h2 align="center">AspectJ Figures Demo Instructions</h2>
<h4>Setup</h4>
<ul>
<li>
<p style="text-align: left">src: contains the end result of the demo, with the Canvas.updateHistory()
call refactored into the src/figures/support/HistoryUpdating.aj aspect</li>
<li>
<p style="text-align: left">src-fresh: contains the plain Java sources that the demo starts with</li>
</ul>
<h4>Reset </h4>
<ul>
<li>run the "reset" target in build.xml to reset overwrite the sources in
src with those in src-fresh</li>
</ul>
<h4>Script</h4>
<div align="center">
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0" style="width: 531.65pt; margin-left: -7.95pt" id="table1">
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Show Figure editor running</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Inspect Point.java</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Use joinpoint probe or Eclipse search to find calls</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">call(void
figures.Canvas.updateHistory())</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Describe places that it�s called</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">create aspect (defines a special class that can crosscut other
classes)</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">aspect HistoryUpdating </span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">write pointcut (has name and parameters)</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">pointcut moves():
</font> </span></p>
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1"> execution(void
Line.setP1(Point)) || </font> </span></p>
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1"> execution(void
Line.setP2(Point));</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">write after advice (runs �on the way back out�)</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">after() returning: move() { <br>
<runs after each move> }</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">extend advice to Point setters (multi-class)</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">call(void FigureElement+.set*(..))</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">capture context & use interface</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">move(FigureElement fe):
this(fe)
&&..</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Show structure, note that SlothfulPoint is now included</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Run & show effect</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1"> </font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Show Point.moveBy history violoation</span></p>
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Want to make sure that sets of private fields of classes implementing
FigureElement only happen from within the set methods</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1">declare warning:
</font> </span></p>
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1"> set(private * FigureElement+.*) <br>
&& !(withincode(*
FigureElement+.set*(..)) || <br>
withincode(FigureElement+.new(..))):</font></span></p>
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family: Courier"><font size="1"> "should only assign to fields
from set methods";</font></span></td>
</tr>
<tr style="height: 33.45pt">
<td style="width: 231px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="text-indent: -.25in; margin-left: 40.5pt">
<span style="font-size: 10.0pt; font-family: Symbol">�<span style="font:7.0pt "Times New Roman"">
</span></span><span style="font-size:10.0pt;font-family:
Tahoma">Write before advice that does precondition checking on Points.</span></td>
<td style="width: 461px; height: 33.45pt; padding: 1.5pt; background: #F7F7F7">
<p class="MsoNormal" style="margin-left:7.5pt">
<span style="font-family:"Courier New""><font size="2">before(int</font><font size="2">
newValue): <br>
set(int Point.*) && args(newValue) {<br>
if (newValue < 0) {<br>
throw new IAE("too small");<br>
} <br>
}</font></span></td>
</tr>
</table>
</div>
<p> </p>
|