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.
- Start with a small code that is easy to catch up with
- Understand how easy to extend it using copy-paste approach but make it harder to maintain at the same time
- Divide the design into smaller pieces using Pyramid of Refactoring approach
- Learn lots of build-in IDE refactoring
- Talk about SOLID design that is the basement of Pyramid of Refactoring
- Start with that same code from part 1 where new requirements were implemented using copy-paste approach without any refactorings (ugh…)
- Describe additional requirements that needs to be implemented
- 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
- Extract the “extension” points using the Pyramid of Refactoring
- 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 :-).