Equip yourself with writing efficient and powerful code which can be easily managed. This fast-paced guide to Scala leads you through the functional and object-oriented concepts that are used in Scala.
You'll learn how to write safer and stable code by using pure functions and immutable data structures.
Scala is a general-purpose programming language, combining elements of object-oriented with functional programming. It is backed by a strong type system and is designed to be concise.
COURSE OBJECTIVE:
• Write Scala applications
• Effectively participate in existing Scala projects
• Recognize and use typical idioms and patterns
• Identify the principles of functional programming and know the essence of advanced functional patterns
TARGET AUDIENCE:
This book is ideal for experienced developers who are interested and wants to learn about the advanced features of Scala language. Prior exposure to basic Scala programming is required, as we skim through the basics and get straight to work.
COURSE PREREQUISITES:
Hardware Requirements:
For an optimal experience, we recommend the following configuration:
• Intel Core i7 or equivalent
• 4 GB RAM
• A connection to the Internet
Software Requirements:
• Windows
• Microsoft Windows 10/8/7 (64 bit)
• JDK 8
• Intellij + Scala plugin
Mac
• Mac OS 10.5 or higher (64 bit)
• JDK 8
• Intellij + Scala plugin
Linux
• Linux OS 64 bit
• KDE, GNOME or Unity DE desktop
• JDK 8
• Intellij + Scala plugin
Access to installation instructions can be provided separately to course material for large training centers and organizations. All source code is publicly available on GitHub and fully referenced within the training material.
COURSE CONTENT:
Day One – Getting Started with Scala
We begin our day by easing ourselves into the world of Scala. We setup our development environment and learn some basics of Scala language.
Lesson One – Setting up the Development Environment
Before starting with the Scala language itself, we will identify how to setup our development environment. we will learn the basics of Scala, such as what the simple Scala program looks like and what a typical developer flow is. We will identify how to structure the Scala program. We will also cover some aspects of testing your Scala program by using Unit testing.
• Recognize the structure of a Scala project
• Identify the use of Scala's sbt tool (interactive build tool) for building and running your project
• Identify how to use the IDE
• Implement interactions with a simple chatbot
Lesson Two – Basic Language Features
We will explore the so-called 'OO' part of Scala such as Java or C++. The object-oriented part of Scala will cover classes and objects, traits, pattern matching, case class, and so on. Finally, we will implement the object-oriented concepts that we learn to our chatbot application.
• Identify the structure of non-trivial Scala programs
• Identify how to use main object-oriented facilities: objects, classes, and traits
• Recognize the details of function call syntax and parameter-passing modes
Lesson Three – Functions
We will cover functional programming with Scala and how object-oriented and functional approaches complete each other. We will cover generic classes and also cover how to create user-defined pattern matching and why is it useful.
• Identify the basics of functional programming
• Identify the basics of generic types in Scala
• Implement user-defined pattern matching
• Recognize and use functional compositional patterns
• Day Two – Scala Collections and Type System
• We begin our day by learning various scala collections and then we will cover types.
Lesson One – Scala Collections
We will start by learning how to work with lists. Afterwards, we'll generalize to sequences and cover some more relevant data structures. Finally, we'll look at how collections relate to monads and how we can use that knowledge to make some powerful abstractions in our code.
• Identify the Scala collections available in the standard library
• Identify how to abstract on sequences by using higher-order Functions
• Implement the important design principles for working with Scala collections
Lesson Two – Scala Type System
In this lesson, we will cover the type system and polymorphism. We will also cover the different types of variance, which provides a way to constrain parameterized types. Finally, we will cover some advanced types such as abstract type members, option, and so on.
• Identify the Scala type hierarchy
• Use the features the Scala type system provides
• Identify abstractions that the Scala type system enables
Lesson Three – Implicits
We will cover implicit parameters and implicit conversions. We'll be learning about how they work, how to use them, and what kind of benefits and perils they provide.
• Describe implicits and how the Scala compiler handles them
• Explain the design patterns that implicits enable
• Analyze the common issues that may arise by overusing implicits
Day Three – Building Code using Functional Programming
We begin our day by focusing on the functional programming aspects of Scala. We will then cover Cats and Doobie, which are the two popular functional programming libraries.
Lesson One – Functional Idioms
We'll cover the core concepts of functional programming like Pure functions, immutability, and higher-order functions. We'll introduce some of the design patterns that are prevalent in large functional programs. Finally, we'll cover two popular functional programming libraries called Cats and Doobie, and use them to write some interesting programs.
• Identify the core concepts of functional programming
• Recognize and implement the popular functional programming design patterns
• Implement Cats and Doobie in your own Scala projects
Lesson Two – Domain Specific Languages
We will cover how Scala makes it possible to write powerful DSLs by providing a few interesting language features. We'll have a brief look at what DSLs are in general terms. We'll also cover a DSL that you'll very likely be using if you're going to work with Scala professionally. Finally, we will implement our own DSL.
• Identify the use of Domain Specific Languages (DSLs)
• Use the DSL that ScalaTest, a popular testing library for Scala, provides
• Design your own DSLs in Scala
FOLLOW ON COURSES:
Not available. Please contact.