Course 496:
Advanced Programming with Scala

(3 days)


Course Description

This course builds on top of the basic course on programming with Scala. It deepens your understanding of the language and covers more idiomatic aspects of the syntax, with an eye to the creation of Domain Specific Languages in Scala and being able to read and understand the most complex code.

Learning Objectives

  • Gain a deep grasp of the Scala programming language
  • Understand the idioms of object-oriented programming in Scala
  • Understand the idioms of functional programming in Scala
  • Get a good feel for implicits, what they are for, and how they work
  • Learn about using Scala to create your own Domain Specific Languages (DSLs)
  • Become comfortable writing advanced Scala code through hands-on labs

Who Should Attend

The intended audience consists of professional developers who have a basic understanding and a little experience with Scala already, who intend to deepen their understanding and practical grasp of the language.


In order to make the most of this course, prospective students should have a couple of years of professional experience in at least one object-oriented programming language and a basic knowledge and experience of Scala.

Course Outline

  • Classes
    • Instantiation
      • Constructor-Local Parameters and Variables
    • Defining and Using Classes
      • Positional and Named Method Parameters
      • Access Modifiers and Scope of Protection
      • Fields and Accessor Methods
  • Inheritance
    • Overriding of Stable/Unstable Members
  • AnyVal
    • What Is AnyVal?
    • How Scala Treat AnyVal Types
    • Extending AnyVal
  • Custom Operators
    • Idiomatic Method Invocation
      • Prefix, Infix, and Postfix Notations
    • Defining Operators
      • Unary, Left-, and Right-Associative Operators
      • Operator Precedence
      • Assignment Operators
  • Traits
    • Using Traits
      • Mixing-In at Object Creation
  • Linearization of Traits
    • Stackable Trait Pattern
    • Abstract Overrides
  • Variance in Scala
    • What Is Variance?
    • Invariant, Contravariant, Covariant
    • Upper Bounds and Lower Bounds
  • Def, Val, Lazy Val
    • Review
    • Run-time Differences
  • Streams
    • Potentially Infinite Collections
  • Functional Programming and Collections
    • For Comprehension Equivalence
    • Functional Use of Option and Try
      • Mapping, Flattening, and Flat-Mapping
  • TDD Principles and ScalaTest
    • Testing Styles
  • Using ScalaTest and ScalaMock
    • Matchers
    • Stub and Verify Approaches
  • Extractors
    • Case Class Features
    • Defining Extractor Methods
      • Fixed Arity
      • Variable Arity
      • Infix Operator
      • Boolean
    • Use of Extractors
      • Pattern Matching
      • Variable Assignment
      • “for” Generators
  • Introduction to Implicits
    • Two Flavors
    • What They Are For
    • How They Work
  • Implicit Parameters
    • Two Flavors
    • Resolving Ambiguities
  • Implicit Conversions
    • Conversion Classes
    • Conversion Methods
    • Implicit Extensions
  • Implicit Application, Resolution, and Scope
  • Call-By-Name vs. Call-By-Value
    • Background
    • Call-By-Name Syntactic Sugar
  • Type Classes
    • Background
    • Definition and Usage
    • Context Bounds
  • Partial Functions
    • What Is a Partial Function?
    • Partial Function Methods
    • Map as a Partial Function
    • Lifting Partial Functions
  • Scala for DSLs
    • Accessor and Mutator Methods
    • Method Invocation Operators
    • Operator Overloading
    • Call-By-Name Blocks
    • Extractor Methods
    • Interpolators
    • Partial Function Idiom

Please Contact Your ROI Representative to Discuss Course Tailoring!