Learning Java Functional Programming
暫譯: 學習 Java 函數式程式設計

Richard M Reese

  • 出版商: Packt Publishing
  • 出版日期: 2015-10-14
  • 售價: $2,400
  • 貴賓價: 9.5$2,280
  • 語言: 英文
  • 頁數: 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 類和單子(monads),這些提供了處理問題的額外方法。設計模式在解決常見問題中發揮了重要作用。您將學習如何使用函數式技術增強這些模式。


從物件導向方法過渡到函數式方法時,擁有 IDE 支持是非常有用的。各章節中展示了重構、除錯和測試函數式程式的 IDE 工具。本書的結尾將這些函數式編程技術整合在一起,以創建一個更全面的應用程式。您會發現這本書是學習和應用 Java 中函數式編程技術的非常有用的資源。

風格與方法


在這個教程中,每一章都以介紹該章所涵蓋的術語和概念開始。然後迅速進入對比物件導向方法與函數式方法,並使用大量程式碼示例進行說明。