/modern-java

Learning reactive functional programming using the book Modern Java in Action

Primary LanguageJava

Modern Programming using Modern Java in Action

Below you will find:

Overview

This was a dive deep into modern programming via a book club for Modern Java in Action. It dives deep into Functional Reactive Programming (FRP), including lambdas, streams, and practical functional and concurrency approaches in depth.

Chapter notes, code and videos (30 sessions!) are available here.

Who?

General programming knowledge is required, but no previous FRP knowledge is required, and even if you're experienced with it, we will dive deep so you may fill in some gaps.

Why this topic?

Functional reactive programming (FRP) is becoming a common way to build systems these days in order to utilize hardware and thrive in a distributed environment, and represents a large shift from modern standard object oriented approaches, so requires some re-training. Modern Java in Action is all about functional reactive programming. It uses Java but the concepts are universally applicable.

This topic encompasses the core skills needed by modern Java engineers.

The Format

People read the chapters ahead of time, and we reviewed & discussed key concepts in the sessions. Coding will be reviewed, but actual coding was to be done as a supplement to reinforce the ideas in our own time. Code from the chapters is in this repo, which should be understood and ideally gone through individually from scratch.

The book

Modern Java in Action

Outline:

  • Part 1: Programming has changed - with functional reactive programming (passing code with behavior parameterization, and lambda expressions)
    • 1-3
  • Part 2: Using streams when working with data, with parallel benefits
    • 4-10
  • Part 3: Modern language constructs to improve code - Optionals, default functions, etc.
    • 11-14
  • Part 4: Reactive programming for more concise concurrency
    • 15-17
  • Part 5: Working with functional programming techniques
    • 18-21

Session Agendas & Notes:

Environment Setup

  1. Clone this repo

Locally installed Java way

  1. Install Java 11 (or the latest but update app references) & gradle
  2. Build & run tests via ./gradlew build
  3. Run via ./gradlew run

Docker way

  1. Install Docker
  2. Create & log into Java container via docker-compose by running this script: ./run_app.sh
  3. Build & run tests: ./gradlew build & run app via ./gradlew run

Example Code

Much of the example code from the book is implemented in this repo. Throughout the chapter notes, it is referenced.

The code is implemented in the typical Java structure, starting in Application.java, where you can choose to run the console-based or controller-based code.