Functional Programming in Java: Harness the Power of Streams and Lambda Expressions 2nd Edition

Subramaniam, Venkat

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2023-08-29
  • 售價: $2,100
  • 貴賓價: 9.5$1,995
  • 語言: 英文
  • 頁數: 250
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1680509799
  • ISBN-13: 9781680509793
  • 相關分類: Java 程式語言
  • 立即出貨 (庫存 < 4)

買這商品的人也買了...

商品描述

Imagine writing Java code that reads like the problem statement, code that's highly expressive, concise, easy to read and modify, and has reduced complexity. With the functional programming capabilities in Java, that's not a fantasy. This book will guide you from the familiar imperative style through the practical aspects of functional programming, using plenty of examples. Apply the techniques you learn to turn highly complex imperative code into elegant and easy-to-understand functional-style code. Updated to the latest version of Java, this edition has four new chapters on error handling, refactoring to functional style, transforming data, and idioms of functional programming.

Don't struggle with the limitations of the imperative style; instead learn to combine object-oriented programming with the functional style to reduce the accidental complexity. Harness the functional programming capabilities of Java to create applications where the program reveals its intentions and your team can quickly understand and modify code to align with changing business requirements. Unlock the power of lambda expressions and the Streams API to turn the oft-written spaghetti code into highly concise, expressive, elegant, and maintainable code. See how Streams make the arduous task of parallelizing code as easy as flipping a switch when superior speed is necessary.

Apply design patterns built around lambda expressions, safely manage resource allocations, use memoization, and learn to transform data into different forms, all while honoring immutability, and providing thread safety to leverage lazy evaluation for efficiency and parallel execution for performance. Move beyond the basics, explore the idioms for writing functional programs. Learn to think functionally by refactoring legacy code into the functional style. And, if your code runs aground due to failures, learn to properly handle errors the functional way.

Don't drown in theory; instead learn the practical functional programming techniques to create superior Java code.

What You Need:

Java version 8 or newer.

商品描述(中文翻譯)

想像一下寫起來就像問題陳述一樣的 Java 程式碼,這種程式碼具有高度表達性、簡潔、易於閱讀和修改,並且降低了複雜性。有了 Java 的函數式編程能力,這不再是一個幻想。本書將引導您從熟悉的命令式風格進入實際的函數式編程方面,並提供大量的示例。將所學的技巧應用於將高度複雜的命令式程式碼轉換為優雅且易於理解的函數式程式碼。本版更新至最新的 Java 版本,新增了四個關於錯誤處理、重構為函數式風格、轉換數據和函數式編程習慣的章節。

不要為命令式風格的限制而苦苦掙扎,相反,學習將面向對象編程與函數式風格相結合,以減少意外複雜性。利用 Java 的函數式編程能力創建應用程序,其中程式碼顯示其意圖,您的團隊可以快速理解並修改程式碼以符合不斷變化的業務需求。利用 lambda 表達式和 Streams API 的威力,將常見的意大利麵式程式碼轉換為高度簡潔、表達性強、優雅且易於維護的程式碼。了解 Streams 如何使並行化程式碼變得簡單,當需要更高的速度時,只需翻轉一個開關即可。

應用建立在 lambda 表達式周圍的設計模式,安全地管理資源配置,使用記憶化技術,並學習將數據轉換為不同形式,同時保持不可變性,並提供線程安全性,以利用惰性評估提高效率和並行執行性能。超越基礎知識,探索撰寫函數式程式的習慣用法。通過將遺留程式碼重構為函數式風格,學習以函數式思維。如果您的程式碼因失敗而遇到困難,學習以函數式方式正確處理錯誤。

不要陷入理論中,相反,學習實際的函數式編程技巧,創建優秀的 Java 程式碼。

所需工具:
Java 8 或更新版本。