Refactoring is very well known in theory. It looks like everyone has heard about it. But do we know how to approach i? Isn’t it often a theory followed by an idea to re-write given part of code because we don’t like it any longer?This hands-on training shows how to handle refactoring in the smallest possible steps, make it everyday practice and grow your refactoring skills. It’s goal is also to motivate people to refactor their code and share their knowledge within their teams continuously.

We will go carefully through the Pyramid of Refactorings :

  • understand the flow
  • extract smaller methods
  • extract smaller classes
  • notify emerging design patterns from relations between classes
  • tidy up the architecture (packages)


The training is mainly focused on working with code using automated refactoring-features that are built into IntelliJ or Eclipse. The source code is based on Java language. The trainer does all the refactorings live in small steps what allows the attendees to follow it with the same changes on their laptops. Remaining 25% of the training is dedicated to motivation part, how to make refactoring a daily habit, some slides and discussions.

Please note also that this is a training about refactoring – not about the design. Different people / teams might prefer different designs whereas the goal of this training is to show how easy / fast we can turn the design upside-down according to our architectural decisions and needs.

Part 1

  1. Start with a small code that is easy to catch up with
  2. Understand how easy to extend it using copy-paste approach but make it harder to maintain at the same time
  3. Divide the design into smaller pieces using Pyramid of Refactoring approach
  4. Learn lots of build-in IDE refactorings
  5. Talk about SOLID design that is the basement of Pyramid of Refactoring


Part 2

  1. Start with that same code from part 1 where new requirements were implemented using copy-paste approach without any refactorings (ugh…)
  2. Describe additional requirements that needs to be implemented
  3. Understand how much more difficult it is now to continue using copy-paste approach and continue to make the code less and less maintainable at the same time
  4. Extract the “extension” points using the Pyramid of Refactoring
  5. Implement the new functionality as and pluggable parts using small amount of TDD


This is a very extensive training and based on the experience the proposed approach is make it is as 2 days of 4 hours. This lets the developers focus on other daily activities in the remaining part of the day. On demand it can also be conducted as one (very extensive) day or (fully occupied) 2 days.

Level : junior and regular developers, although senior developers claim that they’ve learned lots of new things / ideas and shared them with fellow developers.

You will learn how to start from the smallest possible refactorings and end up with emerging design patterns (which is second part of this training :-).