JAVA 8 IN ACTION ABOUT THE BOOK Every new version of Java is important, but Java 8 is a game changer. changer. Java 8 in
Acon is a clearly wrien guide to the new features of Java 8. It begins with a praccal introducon to lambdas, using real-world Java code. Next, it covers the new Streams API and shows how you can use it to make collecon-based code radically easier to understand and maintain. It also explains other major Java 8 features including default methods, Oponal, CompletableFuture, and the new Date and Time API.
FEATURES
/- ` 5 4 9 /
ISBN: 9789351197430 • Pages: 424
Authors: Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft
�
How to use Java 8’s powerful new features
�
Wring eecve mulcore-ready applicaons
�
Refactoring, tesng, and debugging
�
Adopng funconal-style programming
�
Quizzes and quick-check quesons
SUMMARY Java 8 in Acon is a clearly wrien guide to the new features of Java 8. The book covers lambdas, streams, and funconal-style programming. With Java 8’s 8’s funconal features you can now write more concise code in less me, and also automacally benet from mulcore architectures. architectures. It’s me to dig in!
ABOUT THE AUTHORS Raoul-Gabriel Urma is Urma is a soware engineer, en gineer, speaker, speaker, trainer, and PhD candidate cand idate Fusco is an engineer at Red Hat and at the University of Cambridge. Mario Fusco is Mycro is a professor at Cambridge and creator of the lambdaj library. Alan Mycro is cofounder of the Raspberry Pi Foundaon. /dtechpress
/dtechpress
/dreamtechpress
dreamtechpress.wordpress.com
/company/dreamtech-press
TABLE OF CONTENTS PART 1 FUNDAMENTALS
PART 3 EFFECTIVE JAVA 8 PROGRAMMING
1
8
2
3
Java 8: Why should you Care? y Why is Java sll changing? y Funcons in Java y Streams y Default methods y Other good ideas from funconal programming Passing code with Behavior Parameterizaon y Coping with changing requirements y Behavior parameterizaon y Tackling verbosity y Real-world examples
Refactoring, Tesng, and Debugging y y y y
9
Default Methods y y y y
Lambda Expressions y Lambdas in a nutshell y Where and how to use lambdas y Pung lambdas into pracce: the execute around paern y Using funconal interfaces y Type checking, type inference, and restricons y Method references y Pung lambdas and method references into pracce! y Useful methods to compose lambda expressions y Similar ideas from mathemacs
4
5
6
7
Evolving APIs Default methods in a nutshell Usage paerns for default methods Resoluon rules
10 Using Oponal as a Beer Alternave to Null y y y y
How do you model the absence of a value? Introducing the Oponal class Paerns for adopng Oponal Praccal examples of using Oponal
11 Completable Future: Composable Asynchronous Programming y y y y
PART 2 FUNCTIONALSTYLE DATA PROCESSING
Refactoring for improved readability and exibility Refactoring object-oriented design paerns with lambdas Tesng lambdas Debugging
y
Futures Implemenng an asynchronous API Make your code non-blocking Pipelining asynchronous tasks Reacng to a CompletableFuture compleon
Introducing streams y What are streams? y Geng started with streams y Streams vs. collecons y Stream operaons y Summary
12 New Date and Time API
Working with Streams y Filtering and slicing y Mapping y Finding and matching y Reducing y Pung it all into pracce y Numeric streams y Building streams
13 Thinking Funconally
y y y
PART 4 BEYOND JAVA y y y
Implemenng and maintaining systems What’s funconal programming? Recursion vs. iteraon
14 Funconal Programming Techniques y y
Collecng Data with Streams y Collectors in a nutshell y Reducing and summarizing y Grouping y Paroning y The Collector interface y Developing your own collector for beer performance Parallel Data Processing and Performance y Parallel streams y The fork/join framework y Spliterator
Published by:
LocalDate, LocalTime, Instant, Duraon, and Period Manipulang, parsing, and formang dates Working with dierent me zones and calendars
y y y
Funcons everywhere Persistent data structures Lazy evaluaon with streams Paern matching Miscellany
15 Blending OOP and FP: Comparing Java 8 and Scala y y y
Introducon to Scala Funcons Classes and traits
16 Conclusions and where Next Next for Java y y
DREAMTECH PRESS
Review of Java 8 features What’s ahead for Java? WILEY INDIA PVT. LTD.
19-A, Ansari Road, Daryaganj New Delhi-110 002, INDIA Tel: Te l: +91-11-2324 3463-73, Fax: +91-11-2324 3078 Email:
[email protected] Website: www.dreamtechpre www.dreamtechpress.com ss.com
4435-36/7, Ansari Road, Daryaganj New Delhi-110 002, INDIA Tel: +91-11-4363 0000, Fax: +91-11-2327 5895 Email:
[email protected] Website: www.wileyindia.com
Execlusively Distributed by:
Regional Ofces: Bangalore: Tel: +91-80-2313 2383, Fax: +91-80-2312 4319, Email:
[email protected] Mumbai: Tel: +91-22-2788 9263, 2788 9272, Telefax: Telefax: +91-22-2788 9263, Email:
[email protected] /dtechpress
/dtechpress
/dreamtechpress
dreamtechpress.wordpress.com
/company/dreamtech-press