/
estebanFeedback.txt
336 lines (196 loc) · 12.3 KB
/
estebanFeedback.txt
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
335
336
General todo:
rewrite the example using the instance side/dynamic way of writing components. With time, I guess the class side style should be removed (not right now, but I would not use it anymore if I have to write anything).
Left in Chpater case study one
homogeneize newVertical ==> newTopToBottom, newHorizontal ==> newLeftToRight
Did a pass on Chapter case study one
Use the fluid builder to show the classes
Did a pass on Chapter case study one
[ done ] p 13 use #add: instead #addItem: (both apis are supported, but add: is better since more homogeneous.
[done ] p 14 "why not have iconNamed: in presenter that dispatches to self application iconNamed:? May be this is done like that?" ==> Now it is like that.
[ done ] p 22
"can we have multiple instance level layout returned by different
instance side methods and can we pass their name to the openWithSpec:
(is it looking for instance side then class side)?" ==> No, just class side.
We need to discuss how to improve this.
I have the feeling we need to work on "Spec 3" which will instantiate presenters on open time, not as it is now, at initialization time (then we can switch layouts, choose them, etc. in an easier and more efficient way than now).
I removed the question and said that it is only possible so far to change layout with class side layouts.
[ todo : sd: no idea what I should write ] p 24
why do we need the two methods? => We don't. This is for clarity (default and "named" port)
why do we need the setModel: method ==> Because the SpModelPort will call setModel:.
We could add a parameter with the setter method name to make it more flexible, but we will always need a method to receive the model.
[ done ] p 24 section "Styling the application"
We do not have an application at that moment (a child of SpApplication), so I would remove that section and point to the "Styling Applications" chapter.
[done] p 25 I thought that autoAccept: was obsolete? ==> it is
[ done ] p 37
(self new: MyMainPresenter) openWithSpec
better use
(self newPresenter: MyMainPresenter) openWithSpec
(is more clear), or even :
(MyMainPresenter newApplication: self) openWithSpec
[ pending ] p 56
askOkToClose: is not valid anymore, I will add next days a different mechanism
[ pending ] p 57
beUnresizeable : not implemented, but I need to add that too (next days).
Both of this should be ready for book release.
[ todo ] p 58
remove window decoration is made now with `withoutDecorations` method sent to the window presenter.
this is not valid anymore:
WindowExamplePresenter >> title
^ 'Click to grow or shrink.'
(instead, you need to set the title in `initializeWindow:` method).
Same for #windowIcon: in same page.
[ todo ] p. 59
"aboutText:" property is no longer supported for Spec (since this was a Morphic exclusive property that had no much sense anyway).
p. 86
How do we associate an application to a presenter? ==> Two ways:
1. when creating them:
aPresenter := SpPresenter newApplication: application.
2. there is a method:
aPresenter application: application
Each presenter knows its application, then the regular flow would be:
APresenter>>methodInSideAPresenter
aPresenter := OtherPresenter newApplication: self application.
aPresenter openWithSpec.
p. 94
"It is possible that the user requires to listen an output port, but instead trans-
mitting the value to another presenter, other operation is needed."
means you can get the output of a port to do something else than transmit it to another presenter. E.g in the case of
aPresenter transmitTo: otherPresenter
I take the default output port of `aPresenter` and I connect it with the default inpur port of `otherPresenter`. But if I do:
aPresenter transmitDo: [ :output | self doSomethingWith: output ]
I am connecting the default output port of `aPresenter` with a block of whatever I want.
**OLD TRANSMISSIONS, MAYBE IRRELEVANT**
p. 98
"Esteban can you explain transmited ifNotNil: [ destination behav-
ior: transmited methodClass ]?"
In any case, the post transmitted gets 3 arguments: destination, origin and value transmitted. Since the value transmitted can be `nil` (for example, when removing a selection of a list, I need to check for nil before doing anything.
p 13.5
*What kind of event can trigger a transmission?*
Transmissions are executed when output ports are activated. Output ports are defined for each presenter (not all apply in any context) and are accessible through methods (presenter comment lists the available transmissions). We have currently defined this kinds of output ports: Selection, Activation and Text Changed.
More can be defined, but is important to notice that at the end, a transmission is a layer on top of the events a presenter knows.
*I need an example with ports.*
take the case of a list. If they want to react to selection, they can do it using the default (since the default output port is "selection"):
list1 transmitTo: textPresenter1
but if you want to act on a different output port (e.g. activation), you need to declare it explicitly by calling the port:
list1 outputActivationPort transmitTo: textPresenter inputModelPort.
*How can we define ports for a given new component?*
A port is a way to see the events you already have. Say you want a component that can receive a model (this is a typical case).
You have your component, and you need to add the received (since the port will always plug a receiver method):
MyPresenter>>setModel: anObject
model := anObject.
self updatePresenter.
Then you just add a method:
MyPresenter>>inputModelPort
^ SpModelPort newPresenter: self.
And if you want it to be the default you add that too:
MyPresenter>>defaultInputPort
^ self inputModelPort
**FINISH OLD TRANSMISSIONS**
p. 106
Alternate color: I would not recommend doing it like that, but is true we do not have a "spec way" to do it. I added an issue: https://github.com/pharo-spec/Spec/issues/1216 and I will provide such soon.
p. 108
`SpAthensStaticPresenter` is now called just `SpAthensPresenter`
(and is very usable, I have been testing some athens behavior with it).
p. 112
"Panels are replaced by dynamic layouts
To do help I could not understabd the last sentence"
Me neither :PHi Stef,
I made a pass on the Spec2 book and I made some notes. I wanted to make a PR, but I find all structure very confusing for me. Do you have a way to work that allows you to see all together and find what you are looking for ?
Anyway... here my notes (I will find out how to contribute in an easier way, but also, writing in a clear way is not "my thing" so better having a better writer reviewing anything I could do :P).
Notes:
In general, I would rewrite the example using the instance side/dynamic way of writing components. With time, I guess the class side style should be removed (not right now, but I would not use it anymore if I have to write anything).
homogeneize newVertical ==> newTopToBottom, newHorizontal ==> newLeftToRight
I would also use the fluid builder to show the classes?
p 13
use #add: instead #addItem: (both apis are supported, but add: is better since more homogeneous.
p 14
"why not have iconNamed: in presenter that dispatches to self
application iconNamed:? May be this is done like that?" ==> Now it is like that.
p 22
"can we have multiple instance level layout returned by different
instance side methods and can we pass their name to the openWithSpec:
(is it looking for instance side then class side)?" ==> No, just class side.
We need to discuss how to improve this.
I have the feeling we need to work on "Spec 3" which will instantiate presenters on open time, not as it is now, at initialization time (then we can switch layouts, choose them, etc. in an easier and more efficient way than now).
p 24
why do we need the two methods? => We don't. This is for clarity (default and "named" port)
why do we need the setModel: method ==> Because the SpModelPort will call setModel:.
We could add a parameter with the setter method name to make it more flexible, but we will always need a method to receive the model.
p 24 section "Styling the application"
We do not have an application at that moment (a child of SpApplication), so I would remove that section and point to the "Styling Applications" chapter.
p 25
I thought that autoAccept: was obsolete? ==> it is
p 37
(self new: MyMainPresenter) openWithSpec
better use
(self newPresenter: MyMainPresenter) openWithSpec
(is more clear), or even :
(MyMainPresenter newApplication: self) openWithSpec
p 56
askOkToClose: is not valid anymore, I will add next days a different mechanism
p 57
beUnresizeable : not implemented, but I need to add that too (next days).
Both of this should be ready for book release.
p 58
remove window decoration is made now with `withoutDecorations` method sent to the window presenter.
this is not valid anymore:
WindowExamplePresenter >> title
^ 'Click to grow or shrink.'
(instead, you need to set the title in `initializeWindow:` method).
Same for #windowIcon: in same page.
p. 59
"aboutText:" property is no longer supported for Spec (since this was a Morphic exclusive property that had no much sense anyway).
p. 86
How do we associate an application to a presenter? ==> Two ways:
1. when creating them:
aPresenter := SpPresenter newApplication: application.
2. there is a method:
aPresenter application: application
Each presenter knows its application, then the regular flow would be:
APresenter>>methodInSideAPresenter
aPresenter := OtherPresenter newApplication: self application.
aPresenter openWithSpec.
p. 94
"It is possible that the user requires to listen an output port, but instead trans-
mitting the value to another presenter, other operation is needed."
means you can get the output of a port to do something else than transmit it to another presenter. E.g in the case of
aPresenter transmitTo: otherPresenter
I take the default output port of `aPresenter` and I connect it with the default inpur port of `otherPresenter`. But if I do:
aPresenter transmitDo: [ :output | self doSomethingWith: output ]
I am connecting the default output port of `aPresenter` with a block of whatever I want.
**OLD TRANSMISSIONS, MAYBE IRRELEVANT**
p. 98
"Esteban can you explain transmited ifNotNil: [ destination behav-
ior: transmited methodClass ]?"
In any case, the post transmitted gets 3 arguments: destination, origin and value transmitted. Since the value transmitted can be `nil` (for example, when removing a selection of a list, I need to check for nil before doing anything.
p 13.5
*What kind of event can trigger a transmission?*
Transmissions are executed when output ports are activated. Output ports are defined for each presenter (not all apply in any context) and are accessible through methods (presenter comment lists the available transmissions). We have currently defined this kinds of output ports: Selection, Activation and Text Changed.
More can be defined, but is important to notice that at the end, a transmission is a layer on top of the events a presenter knows.
*I need an example with ports.*
take the case of a list. If they want to react to selection, they can do it using the default (since the default output port is "selection"):
list1 transmitTo: textPresenter1
but if you want to act on a different output port (e.g. activation), you need to declare it explicitly by calling the port:
list1 outputActivationPort transmitTo: textPresenter inputModelPort.
*How can we define ports for a given new component?*
A port is a way to see the events you already have. Say you want a component that can receive a model (this is a typical case).
You have your component, and you need to add the received (since the port will always plug a receiver method):
MyPresenter>>setModel: anObject
model := anObject.
self updatePresenter.
Then you just add a method:
MyPresenter>>inputModelPort
^ SpModelPort newPresenter: self.
And if you want it to be the default you add that too:
MyPresenter>>defaultInputPort
^ self inputModelPort
**FINISH OLD TRANSMISSIONS**
p. 106
Alternate color: I would not recommend doing it like that, but is true we do not have a "spec way" to do it. I added an issue: https://github.com/pharo-spec/Spec/issues/1216 and I will provide such soon.
p. 108
`SpAthensStaticPresenter` is now called just `SpAthensPresenter`
(and is very usable, I have been testing some athens behavior with it).
p. 112
"Panels are replaced by dynamic layouts
To do help I could not understabd the last sentence"
Me neither :P