Learning Java Functional Programming

Richard M Reese

  • 出版商: Packt Publishing
  • 出版日期: 2015-10-14
  • 售價: $2,330
  • 貴賓價: 9.5$2,214
  • 語言: 英文
  • 頁數: 296
  • 裝訂: Paperback
  • ISBN: 1783558482
  • ISBN-13: 9781783558483
  • 相關分類: Java 程式語言
  • 海外代購書籍(需單獨結帳)

商品描述

Create robust and maintainable Java applications using the functional style of programming

About This Book

  • Explore how you can blend object-oriented and functional programming styles in Java
  • Use lambda expressions to write flexible and succinct code
  • A tutorial that strengthens your fundamentals in functional programming techniques to enhance your applications

Who This Book Is For

If you are a Java developer with object-oriented experience and want to use a functional programming approach in your applications, then this book is for you. All you need to get started is familiarity with basic Java object-oriented programming concepts.

What You Will Learn

  • Use lambda expressions to simplyfy code
  • Use function composition to achieve code fluency
  • Apply streams to simply implementations and achieve parallelism
  • Incorporate recursion to support an application's functionality
  • Provide more robust implementations using Optionals
  • Implement design patterns with less code
  • Refactor object-oriented code to create a functional solution
  • Use debugging and testing techniques specific to functional programs

In Detail

Functional programming is an increasingly popular technology that allows you to simplify many tasks that are often cumbersome and awkward using an object-oriented approach. It is important to understand this approach and know how and when to apply it. Functional programming requires a different mindset, but once mastered it can be very rewarding.

This book simplifies the learning process as a problem is described followed by its implementation using an object-oriented approach and then a solution is provided using appropriate functional programming techniques.

Writing succinct and maintainable code is facilitated by many functional programming techniques including lambda expressions and streams. In this book, you will see numerous examples of how these techniques can be applied starting with an introduction to lambda expressions. Next, you will see how they can replace older approaches and be combined to achieve surprisingly elegant solutions to problems.

This is followed by the investigation of related concepts such as the Optional class and monads, which offer an additional approach to handle problems. Design patterns have been instrumental in solving common problems. You will learn how these are enhanced with functional techniques.

To transition from an object-oriented approach to a functional one, it is useful to have IDE support. IDE tools to refactor, debug, and test functional programs are demonstrated through the chapters. The end of the book brings together many of these functional programming techniques to create a more comprehensive application. You will find this book a very useful resource to learn and apply functional programming techniques in Java.

Style and approach

In this tutorial, each chapter starts with an introduction to the terms and concepts covered in that chapter. It quickly progresses to contrast an object-oriented approach with a functional approach using numerous code examples.

商品描述(中文翻譯)

使用函數式編程風格創建強大且易於維護的Java應用程序

關於本書



  • 探索如何在Java中結合面向對象和函數式編程風格

  • 使用lambda表達式編寫靈活且簡潔的代碼

  • 通過教程加強您在函數式編程技術方面的基礎,以增強應用程序

本書適合對象


如果您是一名具有面向對象經驗的Java開發人員,並希望在應用程序中使用函數式編程方法,那麼本書適合您。您只需要熟悉基本的Java面向對象編程概念即可開始。

您將學到什麼



  • 使用lambda表達式簡化代碼

  • 使用函數組合實現代碼流暢性

  • 應用流來簡化實現並實現並行處理

  • 使用遞歸支持應用程序功能

  • 使用Optional提供更強大的實現

  • 使用更少的代碼實現設計模式

  • 重構面向對象代碼以創建函數式解決方案

  • 使用特定於函數式程序的調試和測試技術

詳細內容


函數式編程是一種越來越受歡迎的技術,它可以簡化許多在面向對象方法中通常繁瑣和笨拙的任務。了解這種方法並知道何時以及如何應用它是很重要的。函數式編程需要一種不同的思維方式,但一旦掌握,它將非常有價值。


本書通過描述問題,然後使用面向對象方法實現,最後提供適當的函數式編程技術解決方案,簡化了學習過程。


許多函數式編程技術,包括lambda表達式和流,可以幫助您編寫簡潔且易於維護的代碼。在本書中,您將看到許多這些技術的應用示例,從介紹lambda表達式開始。接下來,您將看到它們如何取代舊的方法並結合起來實現令人驚嘆的優雅解決方案。


接著,我們將探討相關概念,如Optional類和monad,它們提供了處理問題的其他方法。設計模式在解決常見問題方面起著重要作用。您將學習如何使用函數式技術增強這些模式。


從面向對象方法過渡到函數式方法,擁有IDE支持非常有用。本書通過章節演示了重構、調試和測試函數式程序的IDE工具。本書的結尾將這些函數式編程技術結合起來,創建一個更全面的應用程序。您會發現本書是學習和應用Java函數式編程技術的非常有用的資源。

風格和方法


在本教程中,每個章節都以介紹該章節涵蓋的術語和概念開始。它迅速進展,通過大量的代碼示例對比面向對象方法和函數方法。