Visão Geral
Este Curso Advanced Programming with Scala se baseia no curso básico sobre programação com Scala. Ele aprofunda sua compreensão da linguagem e cobre aspectos mais idiomáticos da sintaxe, com um olho na criação de Linguagens Específicas de Domínio em Scala e na capacidade de ler e entender o código mais complexo.
Conteúdo Programatico
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