Refactoring Java code to FP, a case study

Posted on December 27, 2015
Tags: java, java-8, FP, refactoring, paper, case-study

Some time ago I wrote an article to present a case study of a refactoring in which I took some imperative Java code and improved its design using functional programming principles. I used it as a teaching device, with success I’d say. But it was wrote in Italian, and I thought it could be more useful if presented in English. So I completely rewrote it and clarified things to be (I hope) more clear and understandable than the original version.

Here is the PDF.

Abstract

This document describes an incremental refactoring of a piece of Java 8 code from imperative to functional style. The main goal of this article is to give to the reader a glipse on the principles and techniques behind functional programming (FP), not to teach Java or a particular FP library for this language. So, the reader is expected to read this article using API references and other supporting material to fill-in the details.