Learning Java functional programming create robust and maintainable Java applications using the functional style of programming

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 f...

Descripción completa

Detalles Bibliográficos
Otros Autores: Reese, Richard M., author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham : Packt Publishing 2015.
Edición:1st edition
Colección:Community experience distilled.
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009629595106719
Tabla de Contenidos:
  • Cover ; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started with Functional Programming; Aspects of functional programming; Functions; Function composition; Fluent interfaces; Strict versus non-strict evaluation; Persistent data structures; Recursion; Parallelism; Optional and monads; Java 8's support for functional style programming; Lambda expressions; Default methods; Functional interfaces; Method and constructor references; Collections; Summary; Chapter 2: Putting the Function in Functional Programming
  • Lambda expressions usageFunctional programming concepts in Java; High-order functions; Returning a function; First-class functions; The pure function; Support repeated execution; Eliminating dependencies between functions; Supporting lazy evaluation; Referential transparency; Closure in Java; Currying; Lambda expressions revisited; Java 8 type inference; Exception handling in lambda expressions; Functional interfaces revisited; Creating a functional interface; Common functional interfaces; Function-type functional interfaces; Predicate-type functional interfaces
  • Consumer-type functional interfacesSupplier-type functional interfaces; Operator-type functional interfaces; Summary; Chapter 3: Function Composition and Fluent Interfaces; Introduction to function composition; Creating composite functions prior to Java 8; Creating composite functions in Java 8; Using the Function interface for function composition; Using the Functional interface to supplement methods; Passing instances of the Functional interface; Fluent interfaces; Fluent interfaces in Java 8; Method chaining and cascading; Contrasting method cascading and fluent interfaces
  • Creating and using fluent interfacesUsing fluent interfaces to hide older interfaces/classes; Using fluent interfaces with the Properties class; Extending fluent interfaces; Default methods and functions; Static default methods; Default methods in Java 8; Multiple inheritance in Java 8; Summary; Chapter 4: Streams and the Evaluation of Expressions; The Stream class and its use; Intermediate and terminal methods; Creating streams; Fixed length streams; Infinite streams; Using the iterate method to create an infinite stream; Using the generate method to create an infinite stream
  • Using the Stream class methodsFilter methods; Using the filter method; Using the skip method; Sorting streams; Mapping methods; Understanding the mapping operation; Implementing the map-reduce paradigm; Using the flatmap method; Lazy and eager evaluation; Stream and concurrent processing; Understanding non-inference; Understanding stateless operations; Understanding side effects; Understanding the ordering; Summary; Chapter 5: Recursion Techniques in Java 8; Recursive data structures; Types of recursion; Using direct recursion; Head and tail recursion; Understanding recursion; The Node class
  • Using head recursion