Scala Design Patterns: Patterns for Practical Reuse and Design [2013 ed.] 3319021915, 9783319021911

Scala is a new and exciting programming language that is a hybrid between object oriented languages such as Java and fun

310 40 3KB

English Pages 291 [324] Year 2013

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Author’s Note......Page 8
Contents......Page 10
Part I: Introduction......Page 24
1.1 Introduction......Page 25
1.2 Introduction to Scala......Page 26
1.3 What Is Scala?......Page 28
1.4 The Class Person......Page 29
1.5 Functional Programming......Page 30
1.6 A Hybrid Language......Page 31
1.7 Scala Oriented Patterns......Page 32
Reference......Page 33
2.1 Introduction......Page 34
2.2 Motivation Behind Patterns......Page 35
2.3.2 What They Are Not?......Page 36
2.3.4 Documenting Patterns......Page 37
2.3.6 Strengths and Limitations of Design Patterns......Page 39
2.6 GoF Design Patterns......Page 40
2.8 Patterns and Scala......Page 41
References......Page 42
3.1 Introduction......Page 44
3.2 The Models......Page 45
3.3 Use Case Diagrams......Page 46
3.4.1 Representing Classes......Page 47
3.4.3 Representing Relationships......Page 49
3.5 Packages......Page 54
3.6 Sequence Diagrams......Page 55
3.7 Collaboration Diagrams......Page 57
3.8 OOD Is Language Independent – Right?......Page 59
3.10 Questions to Consider......Page 60
3.11 The Scala Platform......Page 61
3.13 Fields in UML......Page 62
3.15 Constructors......Page 63
3.16 Properties in Scala......Page 64
3.17 Packages in UML......Page 65
3.19 Scala Traits as Stereo Types......Page 66
3.21 Associations......Page 67
3.23 Aggregation and Composition......Page 69
3.24 Singleton Objects......Page 70
References......Page 71
Part II: Fundamental Patterns......Page 72
4.2 Pattern Classification......Page 73
4.5 Forces/Motivation......Page 74
4.6 Constituent Parts......Page 75
4.8 Concrete Example......Page 76
4.10 Related Patterns......Page 79
5.4 Context......Page 80
5.7 Implementation Issues......Page 81
5.8.2 Extended Singleton Scenario......Page 82
5.8.3 Extended Singleton Example......Page 83
5.9 Pros and Cons......Page 87
5.10 Related Patterns......Page 88
6.4 Context......Page 89
6.6 Constituent Parts......Page 90
6.8 Concrete Example......Page 91
6.9 Pros and Cons......Page 93
7.1 Introduction......Page 94
7.4 Context......Page 95
7.6 Constituent Parts......Page 97
7.8.1 Object Based Approach......Page 98
7.9 Pros and Cons......Page 99
References......Page 100
Part III: Code Reuse Patterns......Page 101
8.4 Context......Page 102
8.7 Implementation Issues......Page 103
8.8 Concrete Example......Page 105
8.9 Pros and Cons......Page 106
9.1 Introduction......Page 107
9.6 Constituent Parts......Page 108
9.8 Concrete Example......Page 109
9.10 Related Patterns......Page 111
10.3 Intent......Page 112
10.7 Implementation Issues......Page 113
10.9 Pros and Cons......Page 114
Reference......Page 115
11.4 Context......Page 116
11.8 Concrete Example......Page 117
Reference......Page 120
12.1 Introduction......Page 121
12.4 Context......Page 123
12.8 Concrete Example......Page 124
12.10 Related Patterns......Page 126
13.1 Introduction......Page 127
13.5 Forces/Motivation......Page 128
13.8 Concrete Example......Page 129
Reference......Page 131
14.4 Context......Page 132
14.8 Concrete Example......Page 133
14.9 Pros and Cons......Page 135
14.10 Related Patterns......Page 136
15.3 Intent......Page 137
15.7 Implementation Issues......Page 138
15.8 Concrete Example......Page 139
15.10 Related Patterns......Page 141
Part IV: Gang of Four Patterns......Page 142
16.2 GoF Patterns......Page 143
17.2.1 Factory Method......Page 145
17.3.1 Adapter......Page 146
17.3.4 Decorator......Page 147
17.3.7 Proxy......Page 148
17.4.1 Chain of Responsibility......Page 149
17.4.4 Mediator......Page 150
17.4.8 Strategy......Page 152
17.4.9 Template Method......Page 153
References......Page 154
18.4 Context......Page 155
18.6 Constituent Parts......Page 156
18.7 Concrete Example......Page 158
18.8 Pros and Cons......Page 161
18.9 Related Patterns......Page 162
19.4 Context......Page 163
19.6 Constituent Parts......Page 164
19.7 Implementation Issues......Page 165
19.8 Concrete Example......Page 166
19.10 Related Patterns......Page 169
20.4 Context......Page 170
20.6 Constituent Parts......Page 171
20.8 Concrete Example......Page 172
20.10 Related Patterns......Page 175
21.3 Intent......Page 176
21.4 Context......Page 177
21.7 Implementations......Page 178
21.7.3 Trait Based Solution......Page 179
21.7.4 Function Based Solution......Page 182
21.8 Concrete Example......Page 185
21.9 Pros and Cons......Page 187
21.10 Related Patterns......Page 188
22.4 Context......Page 189
22.7 Implementation Issues......Page 190
22.8 Concrete Example......Page 191
22.9 Pros and Cons......Page 193
22.10 Related Patterns......Page 194
23.4 Context......Page 195
23.5 Forces/Motivation......Page 196
23.6 Constituent Parts......Page 197
23.8 Concrete Example......Page 198
23.10 Related Patterns......Page 200
24.4 Context......Page 201
24.6 Constituent Parts......Page 202
24.8 Concrete Example......Page 203
24.9 Pros and Cons......Page 205
24.10 Related Patterns......Page 206
25.2 Pattern Classification......Page 207
25.6 Constituent Parts......Page 208
25.8 Concrete Example......Page 209
25.10 Related Patterns......Page 211
26.3 Intent......Page 212
26.6 Constituent Parts......Page 213
26.8 Concrete Example......Page 214
26.9 Pros and Cons......Page 217
Reference......Page 218
27.4 Context......Page 219
27.6 Constituent Parts......Page 220
27.8 Concrete Example......Page 221
27.10 Related Patterns......Page 225
28.4 Context......Page 226
28.6 Constituent Parts......Page 227
28.7 Implementation Issues......Page 228
28.8.1 Function Chain Approach......Page 229
28.8.2 Chain Manager Approach......Page 230
28.8.3 Processing Chain Approach......Page 232
28.9 Pros and Cons......Page 233
28.10 Related Patterns......Page 234
29.3 Intent......Page 235
29.6 Constituent Parts......Page 236
29.7 Implementation Issues......Page 237
29.8 Concrete Example......Page 238
29.10 Related Patterns......Page 240
30.3 Intent......Page 241
30.6 Constituent Parts......Page 242
30.8 Concrete Example......Page 243
30.10 Related Patterns......Page 245
31.1 Introduction......Page 246
31.3 Intent......Page 248
31.6 Constituent Parts......Page 249
31.7 Implementation Issues......Page 250
31.8 Concrete Example......Page 251
31.9 Event Manager Sample Code......Page 252
31.10 Pros and Cons......Page 255
Reference......Page 256
32.3 Intent......Page 257
32.5 Forces/Motivation......Page 258
32.7 Implementation Issues......Page 259
32.8 Concrete Example......Page 260
32.9 Pros and Cons......Page 261
32.10 Related Patterns......Page 262
33.4 Context......Page 263
33.6 Constituent Parts......Page 264
33.8 Concrete Example......Page 265
33.9 Pros and Cons......Page 268
33.10 Related Patterns......Page 269
34.3 Intent......Page 270
34.6 Constituent Parts......Page 271
34.8 Concrete Example......Page 272
34.10 Related Patterns......Page 275
35.4 Context......Page 276
35.7 Implementation Issues......Page 277
35.8 Concrete Example......Page 278
35.9 Pros and Con......Page 280
35.10 Related Patterns......Page 281
Part V: Functional Design Patterns......Page 282
36.1 Introduction......Page 283
36.5 Forces/Motivation......Page 284
36.8.1 Function Based Solution......Page 285
36.8.2 Hybrid Solution......Page 286
36.10 Related Patterns......Page 287
37.1 Introduction......Page 288
37.6 Constituent Parts......Page 289
37.8 Concrete Example......Page 290
37.10 Related Patterns......Page 293
38.1 Introduction......Page 294
38.6 Constituent Parts......Page 295
38.8 Concrete Example......Page 296
38.10 Related Patterns......Page 297
39.1 Introduction......Page 298
39.5 Forces/Motivation......Page 299
39.8 Concrete Example......Page 300
39.10 Related Patterns......Page 303
40.3 Intent......Page 304
40.8 Concrete Example......Page 305
40.10 Related Patterns......Page 307
41.4 Context......Page 308
41.8 Concrete Example......Page 309
41.10 Related Patterns......Page 311
42.2 Pattern Classification......Page 312
42.7 Implementation Issues......Page 313
42.8 Concrete Example......Page 314
42.10 Related Patterns......Page 315
43.3 Intent......Page 316
43.6 Constituent Parts......Page 317
43.8 Concrete Example......Page 318
43.10 Related Patterns......Page 319
44.1 Introduction......Page 320
44.6 Constituent Parts......Page 321
44.8 Concrete Example......Page 322
44.9 Pros and Cons......Page 323
Reference......Page 324

Scala Design Patterns: Patterns for Practical Reuse and Design [2013 ed.]
 3319021915, 9783319021911

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up