Refactoring to Immutability (with Kevlin Henney)

  • 2 Half Days
  • Virtual

Delivered across 2 half-days, this online workshop is for developers looking to improve their software designs by better managing state and removing mutability.

Book For My Team

Your team will learn...

Understand the benefits of reducing or eliminating mutability of state in code

Learn patterns for transforming common and less common coding idioms to a less mutable style

Put these patterns into practice in test-based refactoring hands-on exercises

Identify when and when not to refactor existing code

Appreciate how to write new code in a less mutable style


It has been said that immutability changes everything. But what does that mean in practice? What does it mean for existing code that looks more like the mutant apocalypse than an elegant application of mathematical thinking? Mainstream programming languages are normally grounded in imperative styles — from updating local variables to updating records in databases. But although they have grown from imperative roots, languages such as C# and Java are expressive and evolved enough that they can embrace many different approaches. Indeed, trends in the development of many languages have made immutability and the reduction of mutability easier to support.

Immutability is attractive because it makes code easier to reason about, reduces the possibility of many classes of bug, improves the testability of code, reduces the amount of validation and error-handling code, makes code more scalable when threaded and makes code more thread-safe. However, immutability can be an ideal that is hard to reach, and much advice doesn't cover enough of the situations developers find in their codebases. Refactoring, on the other hand, is all about the art of the possible.

Whether you're working in the cloud or on the desktop, in the mobile space or on the web, steering your code and design style towards immutability offers both short-term and long-term practical benefits. In this hands-on training, we'll be looking at guidance and practice to help reduce the mutability of state in your codebase.


This online workshop is tailored for Java and C# developers looking to write better, safer code. The class is delivered over 2 half-days, and class size is limited to 12 people. You will require:

  • A good internet connection
  • Practical knowledge of C# or Java
  • Some experience of unit testing, ideally in NUnit or JUnit
  • You don't need to worry about IDEs, editors, compilers and all that as the hands-on exercises will be run online in a browser

About The Trainer

Kevlin Henney is a regular columnist for various industry magazines and a well known and popular speaker on topics such OO Design, Patterns, Agile Development and Software architecture at conferences in Europe and North America.

Kevlin currently works as an independent consultant and trainer based in Bristol. He has developed and delivered training courses, consultancy and software across a number of domains ever since getting involved in professional software development in the late 1980s.

Most of Kevlin’s work focuses on software architecture, patterns, development process and programming languages. His work has appeared in several magazines and online publications, including; The Register, Application Development Advisor, Java Report, C++ Report and CUJ. Along with Frank Buschmann and Doug Schmidt, Kevlin is coauthor of A Pattern Language for Distributed Computing and On Patterns and Pattern Languages. He is also editor of the 97 Things Every Programmer Should Know project.

Kevlin Henney

Author, presenter, and consultant on software development. Father, photography and for his sins, a flash fiction writer.

Follow Kevlin
For a breakdown of what to expect in our training, check out our training overview page.

I thought that this was an excellent course. Kevlin Henney is a very engaging instructor who clearly knows his subject matter very well and presents it in a way that keeps your interest throughout. He is informative and approachable. I loved his anecdotes! Great job!!!

Kevlin was super knowledgeable on all aspects of the training course. Slides and content was great. Loved the cyber dojo site to complete the exercises online, and the pairing exercise on day 2 on the same platform was great too with separate break out rooms on zoom for each pair of devs. Also some good book recommendations that I will defo have a read. Very well organised for a virtual training event.

Great thought-provoking course - Great to have Kevlin take time to talk some of the ideas and patterns to life in the exercises. I had previously read thhe Refactoring book Beck/Fowler so this course slotted in nicely to that follow up. I just wished the rest of my team could have attended.

Deloitte logo
Atlassian logo
Workday logo
BMW logo
Amex logo
McAfee logo
PWC logo