Contents
foreword
preface
acknowledgments
about this book
about the cover illustration
Part 1 Scala: the basics
- Chapter 1 Why Scala?
- What’s Scala?
- The current crisis
- Transitioning from Java to Scala
- Coming from a dynamic language
- For the programming language enthusiast
- Summary
- Chapter 2 Getting started
- REPL with Scala interpreter
- Scala basics
- Working with Array and List
- Controlling flow with loops and ifs
- For-comprehensions
- Pattern matching
- Exception handling
- Command-line REST client: building a working example
- Summary
- Chapter 3 OOP in Scala
- Building a Scala MongoDB driver: user stories
- Classes and constructors
- Packaging
- Scala imports
- Objects and companion objects
- Mixin with Scala traits
- Case class
- Named and default arguments and copy constructors
- Modifiers
- Value classes: objects on a diet
- Implicit conversion with implicit classes
- Scala class hierarchy
- Summary
- Chapter 4 Having fun with functional data structures
- Introducing type parameterization
- Type variance with covariance and contravariance
- Lower and upper type bounds
- Higher-order functions, including map, flatMap, and friends
- Using foldLeft and foldRight
- Building your own function objects
- Scala collection hierarchy
- Mutable and immutable collections
- Working with List and ListBuffer
- Working with lazy collections: views and streams
- Divide and conquer with parallel collections
- Summary
- Chapter 5 Functional programming
- What is functional programming?
- Moving from OOP to functional programming
- Functions in all shapes and forms
- Thinking recursively
- Algebraic data types
- Why does functional programming matter?
- Building higher abstractions with monads
- Summary
Part 2 Working with Scala
- Chapter 6 Building web applications in functional style
- Building weKanban: a simple web-based Kanban board
- Building Scala applications using Simple Build Tool
- Introducing the Scalaz HTTP module
- Summary
- Chapter 7 Connecting to a database
- Adding a new story to a weKanban board
- Building the Kanban board page
- Summary
- Chapter 8 Building scalable and extensible components
- Building your first component in Scala
- Types of types in Scala
- Ad hoc polymorphism with type classes
- Summary
- Chapter 9 Concurrency programming in Scala
- What is concurrent programming?
- Challenges with concurrent programming
- Implementing message-passing concurrency with actors
- Composing concurrent programs with Future and Promise
- When should you not use actors?
- Summary
- Chapter 10 Building confidence with testing
- Importance of automated testing
- Automated test generation using ScalaCheck
- Test-driven development cycle
- Better tests with dependency injection
- Behavior-driven development using Specs
- Testing asynchronous messaging systems
- Summary
Part 3 Advanced steps
- Chapter 11 Interoperability between Scala and Java
- Using Java classes in Scala
- Using Scala classes in Java
- Building web applications in Scala using Java frameworks
- Summary
- Chapter 12 Scalable and distributed applications using Akka
- The philosophy behind Akka
- Simple concurrency with Akka
- Building a real-time pricing system: Akkaoogle
- Adding asynchronous HTTP support with Play2-mini
- Summary
 
index