-
Notifications
You must be signed in to change notification settings - Fork 0
/
session6.txt
156 lines (117 loc) · 2.78 KB
/
session6.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
| \b\*Scala Workshop - session 6
1) Discuss "homework" (Section 3 - Section 5)
2) Coursera
3) Short Recap of Sections 1 - 5
4) Introduction to play framework
5) Homework
6) Feedback
---
| \b\* Coursera
https://www.coursera.org/courses?languages=en&query=scala
https://www.coursera.org/specializations/scala
---
| \b\* Short Recap of Section 1
* scala installation
* scala console / interpreter
* Objects & References
* Vals & Vars
* Lazy Vals
* Methods
* repeated parameters
* named parameters
* default values
* lazy evaluation
* multiple parameter lists
---
| \b\* Short Recap of Section 2
* sbt & idea
* Functions
* higher order functions
* Lambdas
* Control Structures
* if
* while
* Tuples
* Arrays
---
| \b\* Short Recap of Section 3
* Listen
* Concatenation
* Transformationen
* fold & reduce
* mutable List
* Maps
* Concatenation
* mutable Map
* Classes
* Objects
* Companion Objects
---
| \b\* Short Recap of Section 4
* Case Classes
* Pattern Matching
* Simple Match
* Constant pattern
* Wildcard pattern
* Variable pattern
* Constructor Pattern
* Variable Binding
* Tuple Patterns
* Pattern Guard
* Typed Patterns
* Patterns in variable declaration
* Abstract Classes
* Traits
---
| \b\* Short Recap of Section 5
* Pattern Matching mit Listen
* Diamond Problem & Traits
* Futures
* Execution Context
* Promises
* For-comprehension
---
| \b\* Introduction to play framework - activator
activator is a wrapper for sbt allowing easy creation of new projects
To install use
brew install typesafe-activator
apt-get install typesafe-activator (?)
or go to
https://www.lightbend.com/activator/download
---
| \b\* Introduction to play framework - create a new project
activator list-templates | less
activator new myFancyPlayProj play-scala
---
| \b\* Introduction to play framework - useful sbt commands
Run play app:
sbt run
Run play app on port 9876:
sbt run -Dhttp.port=9876
Run play and open debug port 9999:
sbt run -jvm-debug 9999
see also https://www.playframework.com/documentation/2.5.x/PlayConsole
---
| \b\* Introduction to play framework - using the sbt console
Enter sbt console:
sbt
reload - reload sbt configuration
update - update dependencies
clean - delete "target/" dir
compile
--
test - run all tests
~test - ... on each source code change
testOnly x.y.Z - run only the test specified
~testOnly - ... on each source code change
--
console - open scala console
test:console - open scala console (sourcing the test sources)
--
stage - copy all jars, resources & configuration to target/universal/stage/
dist - run stage command and zip result to target/universal/myfancyplayproj-1.0-SNAPSHOT.zip
---
| \b\* Homework for next time
Write some play app - think about what it should do yourself :-)
---
| \b\* Feedback