Scala Programming Language Training

  • Learn via: Classroom / Virtual Classroom / Online
  • Duration: 3 Days
  • Download PDF
  • We can host this training at your preferred location. Contact us!

Scala is an open source language that combines an object oriented approach with a functional programming paradigm. It has become popular due to its scalability, flexible syntax, interoperability with Java and pattern matching. This course will introduce the fundamentals of Scala from the context of a Java background. It covers what is different between the two languages, how they are related and how to adopt a functional, rather than object oriented, approach.

The course covers a number of topics, starting from an object oriented perspective and adds more functional programming concepts in at each stage. By the end of the course, delegates should be able to design, create and test reliable Scala projects. We present this course through a combination of lectures, discussions and practical exercises. Topics are explained and demonstrated with time provided to refine and develop concepts in order to fully understand them. Additional information is provided in appendices covering interoperability with Java.

There are no prerequisites for this course.

  • Developers
  • IT Managers

  • At the end of this course you will be able to
  • Understand the difference between mutable and immutable data
  • Understand the basic syntax used by Scala
  • Be able to create objects and classes using Scala
  • Understand variable scoping and Implicit function calls
  • Understand traits and inheritance
  • Have an understanding of the functional programming paradigm and how it differs from the object oriented approach
  • Understand the concept of currying and lambda functions
  • Be able to use collections and generics with functional programming
  • Understand pattern matching

Introducing Scala

  • What is Scala
  • Advantages and Disadvantages to using Scala
  • Scaladocs
  • Scala Libraries
  • Scala tools - Repl and Eclipse

Basic Scala Syntax

  • Variables and Data types
  • Mutable vs Immutable data
  • Operators
  • Statement blocks
  • Conditionals
  • Loops , Guards and Yielding
  • Functions
  • Simple I/O

Objects in Scala

  • Creating objects
  • Creating new operators
  • Companion Objects and Singletons
  • Val vs Def
  • Exception Handling: Throwing exceptions and why not to

Inheritance and Traits

  • Simple Inheritance in Java and Scala
  • Abstract methods and classes
  • Traits
  • Multiple inheritance using traits
  • Packages

Unit Testing and TDD

  • What is unit testing
  • Scala Test
  • Installing and running simple tests
  • Test styles: Flat Spec and feature Spec
  • Matchers and Exception catching

Functional Programming

  • Advantages and disadvantages to the functional programming style
  • Pure functions
  • Higher order functions
  • Lambda (anonymous) functions
  • Closures
  • Currying
  • Combining functions
  • Recursion
  • Lazy Evaluation and partially applied functions

Collections and Generics

  • Generic types in Java and Scala
  • Arrays and the Array Buffer
  • Ranges
  • Iterating and transforming collections
  • Lists
  • Tuples
  • Maps
  • Zipping and unzipping collections
  • Variance and type bounds

Functional programming with Collections

  • The map function
  • forEach
  • filter
  • flatMap
  • Options

Pattern Matching

  • Case classes
  • match ... case
  • Capturing variables
  • Matching Lists
  • Matching and Recursion
  • Deep Matching

Contact us for more detail about our trainings and for all other enquiries!