Solve real-life programming problems with a fraction of the code that pure object-oriented programming requires. Use Scala and Clojure to solve in-depth problems with two sets of patterns: object-oriented patterns that become more concise with functional programming, and natively functional patterns. Your code will be more declarative, with fewer bugs and lower maintenance costs.

Buy Now

Select a DRM-free Format:

In Stock
In Stock
Buy the eBook and get these DRM-free formats delivered immediately:
  • epub (for iPhone/iPad, Android, eReaders)
  • mobi (for Kindle)
  • PDF
We can automatically send them to your Kindle or Dropbox, and for a social reading experience we can link the book to your Readmill account. (You'll need to log in to enable these options.)

This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as the authors add material and correct mistakes. You'll get the final eBook when the book is finished.

If you buy the combo pack (Beta eBook + finished Paper Book) now, you'll get the Beta eBook immediately. You'll get the finished paper book when it's released (we're currently estimating 2013-10-15, but these dates can change).

 

About this Book

  • 250 pages (est)
  • Published:
  • Release: B3.0 (2013-05-13)
  • ISBN: 978-1-93778-547-5

Functional languages have their own patterns that enable you to solve problems with less code than object-oriented programming alone. This book introduces you, the experienced Java programmer, to Scala and Clojure: practical, production-quality languages that run on the JVM and interoperate with existing Java. By using both the statically typed, type-inferred Scala and the dynamically typed, modern Lisp Clojure, you’ll gain a broad understanding of functional programming.

For each pattern, you’ll first see the traditional object-oriented solution, and then dig into the functional replacements in both Scala and Clojure. These patterns are common in the functional world and deserve to become part of your problem-solving toolkit. On the object-oriented side, you’ll see many common patterns, such as Command, Strategy, and Null Object. On the functional side, you’ll learn core functional patterns such as Memoization, Lazy Sequence, and Tail Recursion.

Each pattern helps you solve a common programming problem. Working through them gives you a set of patterns you can use to solve problems you come across while writing programs. Finally, you’ll learn how to work your existing Java code into new Scala or Clojure projects. You can start off small, adding functional code little by little, so you can complement your existing knowledge with Scala and Clojure as these languages gain popularity on the JVM.

What You Need

Clojure 1.5 and Scala 2.10. Optionally, Eclipse with plugins.

Contents and Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

Preface

  • How This Book Is Organized
  • Pattern Template
  • Why Scala and Clojure
  • How To Read This Book
  • Patterns And Functional Programming
    • What Is Functional Programming
    • Pattern Glossary
  • Tinyweb: Patterns Working Together excerpt
    • Introducing Tinyweb
    • Tinyweb In Java
    • Tinyweb In Scala
    • Tinyweb In Clojure
  • Replacing Object Oriented Patterns
    • Introduction
    • Replacing Functional Interface
    • Replacing State Carrying Functional Interface
    • Replacing Command excerpt
    • Replacing Builder For Immutable Object
    • Replacing Iterator
    • Replacing Template Method
    • Replacing Strategy
    • Replacing Null Object
    • Replacing Decorator
    • Replacing Visitor
    • Dependency Injection
  • Functional Patterns
    • Introduction
    • Tail Recursion excerpt
    • Mutual Recursion
    • Function Builder
    • Filter-Map-Reduce
    • Domain Specific Language
    • Memoization
    • Focused Mutability
    • Chain Of Transformations
    • Lazy Sequence
    • Customized Control Flow

About the Author

Michael Bevilacqua-Linn has been programming computers ever since he dragged an Apple IIGS into his fifth grade class to explain loops and variables to pre-teenagers. He works for Comcast, where he builds distributed systems that power infrastructure for their next generation services. In his spare time he likes rock climbing and good beer, though not at the same time. He blogs at mblinn.com.

Upcoming Author Events

  • 2013-04-02: Michael Bevilacqua-Linn
    Functional Programming Patterns (Philly ETE)
  • 2013-06-10: Michael Bevilacqua-Linn
    Using Akka and Scala in a custom Paxos implementation. (Scaladays NYC)

Latest Topics in the Forums…

Join the Discussion