You are previewing Functional Programming for Java Developers.
O'Reilly logo
Functional Programming for Java Developers

Book Description

Software development today is embracing functional programming (FP), whether it’s to write concurrent programs or to manage Big Data. Where does that leave Java developers? This concise book offers a pragmatic, approachable introduction to FP for Java developers or anyone who uses an object-oriented language. Using exercises in each chapter, you'll learn how to apply FP principles to your Java code.

Table of Contents

  1. Functional Programming for Java Developers
  2. A Note Regarding Supplemental Files
  3. Preface
    1. Welcome to Functional Programming for Java Developers
    2. Conventions Used in This Book
    3. Using the Code Examples
      1. Getting the Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgments
  4. 1. Why Functional Programming?
    1. I Have to Be Good at Writing Concurrent Programs
    2. Most Programs Are Just Data Management Problems
    3. Functional Programming Is More Modular
    4. I Have to Work Faster and Faster
    5. Functional Programming Is a Return to Simplicity
  5. 2. What Is Functional Programming?
    1. The Basic Principles of Functional Programming
      1. Avoiding Mutable State
      2. Functions as First-Class Values
      3. Lambdas and Closures
      4. Higher-Order Functions
      5. Side-Effect-Free Functions
      6. Recursion
      7. Lazy vs. Eager Evaluation
      8. Declarative vs. Imperative Programming
    2. Designing Types
      1. What About Nulls?
      2. Algebraic Data Types and Abstract Data Types
    3. Exercises
  6. 3. Data Structures and Algorithms
    1. Lists
    2. Maps
    3. Combinator Functions: The Collection Power Tools
    4. Persistent Data Structures
    5. Some Final Thoughts on Data Structures and Algorithms
    6. Exercises
  7. 4. Functional Concurrency
    1. The Actor Model
    2. Software Transactional Memory
    3. Exercises
  8. 5. Better Object-Oriented Programming
    1. Imperative, Mutable Code
    2. The Liskov Substitution Principle
    3. More on Design Patterns
      1. Pattern Matching
    4. What Makes a Good Type?
    5. Rethinking Object-Oriented Middleware
    6. Exercises
  9. 6. Where to Go From Here
    1. Functional Tools for Java
    2. A Recap
    3. Exercises
  10. A. References
  11. Glossary
  12. About the Author
  13. Colophon
  14. Copyright