This training is intended to enable developers or development managers, who are experienced programmers in Java or other production languages like C++, C# or Ruby, to confidently start programming in Scala.
The presentation will frequently be mixed with hands-on exercises that give you a good opportunity to try what you have learnt and a chance to clarify your understanding.
After having participated in this course you should:
- be a competent user of Scala constructs in application code
- know and be able to apply the functional programming style in Scala
- know how to use the fundamental Scala tools
- be confident to start using Scala in production applications
Program
Why Scala?
- Short history
- Overview of Scala's core characteristics
Setting up the development environment
- Installing the Scala distribution
- Installing Eclipse and the Scala plugin
- Installing sbt
First steps
- Interactive programming in the REPL
- Variables and methods
- Expressions and type inference
- First glance at functions
Basic OO features
- Classes, class parameters, constructors
- Fields, class parameters as fields
- Methods
- Operators
- Named and default arguments
- Packages and imports
- Access modifiers
- Singleton objects, companions, Predef
- Case classes
Testing in Scala
- sbt managed dependencies
- Test-driven development with triggered test (~test)
- Testing with specs2
Collections and functional programming
- Collection hierarchy, creating instances
- Type parameters
- Tuples
- Immutability versus mutability
- Some important collection methods
- Higher-order functions and function literals
- Functions values, function types, short notation
- Important higher order functions: map, flatMap and filter
For-expressions and -loops
- Generators
- Filters
- Definitions
- Translation of for-expressions and -loops
Inheritance and traits
- Extending classes
- Final and sealed classes
- Enumerations
- Overriding members
- Abstract classes
- Implementing abstract members
- Standard type hierarchy
- Traits and mix-in composition
Pattern Matching
- Match-expressions
- Pattern types
- Pattern guards
- Patterns outside of match expressions
Dealing with optional values
- (Higher order) functions on Option
- Handling exceptions optionally