About the course
Scala is a powerful, concise, and expressive programming language that elegantly integrates both functional programming (FP) and object-oriented programming (OOP) paradigms. Running on the Java Virtual Machine (JVM), Scala benefits from the vast Java ecosystem while offering significant advantages in terms of code brevity, type safety, and suitability for building robust, high-performance, and scalable applications. It is a language of choice for demanding domains such as big data processing (Apache Spark is implemented in Scala) and concurrent systems (leveraging frameworks like Akka). This 4-day intensive hands-on training course provides a comprehensive deep dive into the Scala language, covering its core syntax, type system, key programming paradigms, and essential libraries needed to start building production-ready applications. It is designed to equip developers with a strong foundation for tackling modern development challenges at scale.
The course begins with an introduction to Scala's background, history, and development environment, guiding participants through setting up their tooling and writing their first Scala programs. Core language fundamentals are explored in detail, including variables, fundamental data types, functions, control flow constructs, and expressions. A significant portion is dedicated to mastering Scala's Object-Oriented features, covering classes, constructors, the distinction between immutable and mutable states, singleton objects, companion classes, inheritance, abstract classes, and the powerful and nuanced use of traits – a key mechanism for code reuse and flexible composition. The course also dives deep into Functional Programming concepts, explaining the "why" behind FP, defining first-class functions (including anonymous functions and closures), function composition, recursion, and crucially, working effectively with Higher Order Functions (functions that take or return other functions), including techniques like partial application and currying.
Beyond the core OOP and FP paradigms, the course covers essential Scala features like using Option and Either for safely handling optional values and potential errors, mastering powerful Pattern Matching with case classes and extractors, working effectively with standard Collection Classes (Arrays, Tuples, Lists, Sets, Maps), and applying functional programming methods (map, filter, flatMap, fold) to manipulate collections concisely. Robust Exception Handling is covered, including both traditional try-catch blocks and more functional approaches. The course explores project structure using packages, imports, and access modifiers, delves into other important language features like Lazy Vals and the often-used Implicits (implicit conversions, parameters, objects, classes), and provides an introduction to Testing with ScalaTest. The course concludes with an introduction to Concurrency concepts using either the Actor Model with Akka Actors or the concepts of Futures and Promises, providing initial exposure to building concurrent applications in Scala.
Instructor-led online and in-house face-to-face options are available - as part of a wider customised training programme, or as a standalone workshop, on-site at your offices or at one of many flexible meeting spaces in the UK and around the World.
-
- Explain Scala's background, history, and key features, and set up the Scala development environment and tooling.
- Understand and apply core Scala language features, including variables, data types, functions, control flow, and expressions.
- Master Scala's Object-Oriented concepts: Classes, Objects, Inheritance, and Traits.
- Understand and apply Functional Programming concepts: Functions as first-class citizens, Closures, Higher Order Functions (including partial application and currying), and recursion.
- Effectively use Option and Either and leverage powerful Pattern Matching (including Case Classes and Extractors).
- Work with standard Scala Collection Classes and apply functional programming methods (map, filter, flatMap, fold) to manipulate collections.
- Implement robust Error Handling using both traditional and functional approaches.
- Understand and apply Implicits (conversions, parameters, objects, classes) and other language features like Lazy Vals.
- Manage Scala project structure using Packages, Imports, and Access Modifiers.
- Gain an introduction to Testing in Scala and fundamental concepts of Concurrency (Akka Actors or Futures/Promises).
-
This 4-day intensive hands-on training course is designed for developers who want to learn the Scala programming language for building modern, scalable, and concurrent applications. It is ideal for:
Developers with experience in Object-Oriented or Functional Programming languages.
Java developers looking to learn a powerful, concise language running on the JVM.
Teams needing to build high-performance, scalable, and reliable systems.
Developers interested in big data processing frameworks like Apache Spark or concurrent application development with Akka.
-
Participants should have:
Prior programming experience in at least one other language (essential).
Familiarity with the JVM (although we can cover Java Virtual Machine during the course).
A basic understanding of Object-Oriented Programming concepts (beneficial but not mandatory).
Exposure to Functional Programming concepts would also be advantageous (but the course will introduce you to them).
We can customise the training to match your team's experience and needs - with more time and coverage of fundamentals for newer developers, for instance.
-
This Scala course is available for private / custom delivery for your team - as an in-house face-to-face workshop at your location of choice, or as online instructor-led training via MS Teams (or your own preferred platform).
Get in touch to find out how we can deliver tailored training which focuses on your project requirements and learning goals.
-
Introduction to Scala
Welcome and Introductions.
Scala Background, History, and Philosophy.
Key features and strengths of Scala.
The Scala Ecosystem (SBT, Libraries, etc.).
Scala Environment: Setting up the JDK and Scala.
Scala IDEs / tooling (IntelliJ IDEA, VS Code).
Creating and running a Scala Hello World Program.
Hands-On Lab: Setting up the development environment, compiling and running a basic Scala program.
Getting Started with Scala
Variables (var and val) and their use (preference for val).
Data Types in Scala (primitive and reference).
Defining and calling Functions.
Function parameters and return types.
Named parameters.
Comments.
Flow of Control: if/else, match (basic introduction), loops (while, do-while).
Expressions: Everything is an expression in Scala.
Hands-On Lab: Writing code using variables, data types, functions, and basic control flow.
Scala Classes
Defining classes.
Constructors and Auxiliary Constructors.
Defining Methods within classes.
Invoking methods, passing parameters.
Understanding Immutable and Mutable classes and variables.
Hands-On Lab: Defining and instantiating classes, calling methods, working with mutable and immutable objects.
Further Scala Classes, Option, and Pattern Matching
Class level code.
Singleton Objects: Creating single instances.
Companion Classes and Objects.
Use of Option and None: Handling the presence or absence of values safely.
Introduction to Pattern Matching: Basic syntax and use cases.
Hands-On Lab: Working with singleton objects, companion objects, using Option and None, applying basic pattern matching.
Inheritance
Inheritance in Object-Oriented programming revisited.
Scala Types and Type System overview.
Defining Abstract Classes.
Overriding methods and fields.
Using the Super key word (extending versus overriding).
The Final Keyword to prevent overriding or inheritance.
Protected members.
Polymorphism in Scala.
Sealed Classes.
Hands-On Lab: Implementing inheritance with abstract classes, overriding members, using super and final.
Traits in Scala
Introduction to Scala traits: Defining reusable interfaces and behaviour.
Traits and Classes / Objects: Mixing traits into classes and objects.
Using Traits: Abstract and concrete members in traits.
Trait Inheritance.
Trait Abstract Methods.
Hands-On Lab: Defining and using traits, mixing traits into classes.
Further Traits and Package Management
Further Traits: Marker traits, Trait Dependencies, Universal Traits, Sealed traits, Enumeration trait.
Discussion: To Trait or not to Trait (when to use traits vs. abstract classes).
Packages: What is a Package?
Nested Packages.
Multiple Packages per File.
Root package references.
Chained Packages.
Importing: Various import syntax options.
Access Modifiers (private, protected, public).
Qualified Access Modifiers (private[package]).
Package Objects.
Hands-On Lab: Working with advanced trait concepts, organising code into packages, using import statements and access modifiers.
Collection Classes in Scala
Overview of the Scala Collection hierarchy (immutable and mutable).
Working with fundamental collections: Arrays, Tuples, Lists, Sets, Maps.
Common operations on collections (accessing elements, adding/removing, size).
Understanding mutability and immutability in collections.
Type Parameterization in collections.
Hands-On Lab: Using various collection types, performing basic operations, understanding immutable vs. mutable collections.
Functions In Scala (Part 1)
Why Functional Programming? Principles and benefits.
Defining Functions: Revisited and in detail.
Functions as first-class citizens.
Anonymous Functions (lambdas).
Function Composition (compose and andThen).
Closures: Functions that capture their environment.
Functions and Methods: Understanding the distinction.
Hands-On Lab: Writing anonymous functions, using function composition, creating and using closures.
Functions In Scala (Part 2)
Recursion in Scala: Recursive function design.
Tail Recursion and @tailrec annotation.
Higher Order Functions introduction: Functions that take or return other functions.
Using Functions as Parameters.
Using Functions as return results.
Using Types to simplify Higher Order Function definitions.
Partially Applied Functions.
Currying Functions.
Pas by Value v Pass By Name parameters.
Hands-On Lab: Implementing recursive functions, writing and using Higher Order Functions, creating partially applied and curried functions.
Collections and Functional Programming
Applying functional programming concepts to collections.
The map function: Transforming collection elements.
The filter function: Selecting collection elements.
The flatMap function: Combining mapping and flattening.
Fold operations: foldLeft and foldRight for aggregating collections.
Other common functional collection methods (e.g., reduce, find, forall, exists).
Hands-On Lab: Using map, filter, flatMap, foldLeft, foldRight, and other functional methods on various collections.
Other Language Features & Exception Handling
Lazy Vals: Understanding lazy evaluation.
Introduction to Implicit Conversions.
Introduction to Implicit Parameters.
Introduction to Implicit Objects and Implicit Classes.
Using Scala Annotations.
Exception Handling: Traditional Try-Catch blocks from Java.
Limitations with this approach in Scala.
Functional Exception Handling: Using Try, Success, and Failure.
Recovering from Exceptions functionally.
Use of Option and Either for handling potential errors gracefully.
Defining custom exception types.
Hands-On Lab: Experimenting with Lazy Vals and Implicits, implementing exception handling using Try/Success/Failure and Option/Either.
Generics
Understanding Generics: Writing code that works with different Types.
Type parameters in classes, traits, and functions.
Variance (Covariance, Contravariance, Invariance) - overview.
Type Bounds.
Hands-On Lab: Writing generic functions and classes.
Testing in Scala
Importance of testing software.
Introduction to Testing Frameworks in Scala.
Using ScalaTest: A popular testing framework.
Writing Unit Tests.
Functional Test Suites.
Spec Based testing (e.g., using WordSpec or FlatSpec styles).
Running tests with SBT.
Hands-On Lab: Setting up ScalaTest, writing and running basic unit and spec-based tests.
Concurrency Option 1: Akka Actors
What is the need for concurrent/distributed systems?
The Actor Model: Principles and concepts.
Actor Concepts: State, Behaviour, Mailbox, Messages.
Actor Communications: Sending messages.
Introduction to Akka Actors.
Akka Actor Application Structure and Naming.
Actor DSL (Domain Specific Language).
Actor Incarnation.
Dispatching Actors.
Hands-On Lab: Creating simple Akka Actors, sending and receiving messages.
Concurrency Option 2: Futures and Promises
Optional Module for in-house Scala training courses (instead of Actors).
Why Asynchronous Programming? Handling non-blocking operations.
Introduction to Futures: Representing the result of an asynchronous computation.
Working with Scala Futures: Creating and composing futures.
Futures and Completion: Handling success and failure callbacks.
Introduction to Promises: Managing the completion of a Future.
Working with Scala Promises.
Hands-On Lab: Working with Scala Futures and Promises, composing asynchronous operations.
-
Scala-Lang.org: The official website for the Scala programming language, offering documentation, news, and downloads.
The Scala Book: An official, freely available online book that provides a comprehensive introduction to Scala.
Scala Documentation: The main hub for all Scala documentation, including the API reference.
SBT (Scala Build Tool): The primary build tool for Scala projects. Documentation is essential for managing dependencies and building code.
Akka Documentation: If covering Akka Actors, this is the official documentation.
Scala Standard Library API: Documentation for the built-in types and collections, including Futures and Promises.
ScalaTest Documentation: Documentation for the ScalaTest testing framework.
Awesome Scala: A curated list of Scala frameworks, libraries, software, and resources.
Trusted by