Effective Refactoring to Clean Code & Patterns

Hands On Workshop

This hands-on workshop teaches how to retain clean code by refactoring in the smallest possible steps so it becomes everyday practice. It will enable you to continue with much more complex refactorings towards design patterns where applicable.

This way you learn to tackle emergent design from a long term point of view. You will possess skills to make architectures more extendable and readable by applying patterns when you need them without prior over-engineering.

Attendees will gain:

  • technical skills based on self live coding;
  • awareness of their attitude that is always reflected in outcome code quality.

Attendees will understand:

  • how the organization of work within the team/company influences final code quality;
  • how patterns solve the problems at the current state of design but without continuous refactoring introduces next issues if the design is followed with copy-paste thoughts only.

Attendees will experience:

  • how design patterns might enable but also impede further development for new business cases;
  • a threshold of complexity behind which usage of design patterns pays off;
  • by trying out ideas to experiment with adjustments to the way their development process is organized so they can improve the quality of the final product.

More about training

Refactoring is very well known in theory. It looks like everyone has heard about it. But do we know how to approach it? Isn’t it often a theory followed by an idea to re-write a given part of code because we are afraid to touch the given code any longer? During the workshop, we go carefully through the concept of the Pyramid of Refactoring that enables you to keep your code clean through continuous refactoring and turn the code architecture into design patterns when it brings benefits.

  • Simplifying the logic of algorithms
  • Extracting smaller methods
  • Extracting smaller classes
  • Notifying emerging design patterns
  • Cleaning up the architecture

The training is mainly focused on working with code using automated refactoring features that are built into IntelliJ. The source code is based on the Java language. The trainer does all the refactorings live in small steps which allows the attendees to follow it with the same changes on their laptops. The remaining 25% of the training is dedicated to the motivation part, how to make refactoring a daily habit in order to keep technical debt under control.

Please note also that this is a training mainly about refactoring – not necessary about which the design is the best. Different teams might prefer different architectures whereas the goal of this training is to show how easy/fast we can change the low-level design and keep the design emergent according to our architectural decisions and needs. Fortunately, the need to use some patterns is not visible at the beginning of development. This way we can avoid over-engineering and make use of patterns only when they decrease code complexity. We do our best to keep the code simple but when the codebase is growing we begin to regret a given design pattern is missing as part of the solution. ... and this is the time to apply the refactoring to patterns, for example, to replace conditional statements with polymorphism. This way we tackle code complexity with Strategy, State, Abstract Factory or any other pattern. This approach allows us to avoid over-engineering from the beginning and refactor our codebase just in time when it brings value, decreases complexity, and saves time and money.

On the workshop you will

Learn from lecture supported by slides

Solve coding challenges

Complete practical exercises

During the workshop we cover:

Plan of training

Core ideas

  • continuous refactoring to Clean Code in small steps
  • refactoring into selected design patterns
  • understanding the relationship between outcome quality and management
  • inspiring to experiment with quality by adjusting development processes (like Kanban / Scrum)

Table of content

Day 1 - Effective Refactoring to Clean Code

Refactoring that ends up with Clean Code

  • Smaller Methods
  • Smaller Classes
  • Simpler Conditions / Flow
  • More readable and extendable codebase

Day 2 - Effective Refactoring to Design Patterns

Keynote: 5 Dysfunctions of a Team that impede refactoring

Refactoring that ends up with the below design patterns

  • Strategy
  • Interpreter
  • Factory Methods
  • Chain of Responsibility
  • State (if the time allows)

Day 3 - Effective Refactoring to Design Patterns

Refactoring that ends up with the below design patterns

  • (Fluent) Builder
  • Iterator (as domain)
  • Template Method
  • Bridge
  • Abstract Factory
  • Command (if the time allows)

How long does it take?

This is very extensive training. Based on the experience the proposed approach is to make it 3 days of 8 hours (including lunch and coffee breaks).

Requirements

  • Professional experience as a developer
  • Fluency in Java Language
  • Computer with IntelliJ installed (Community edition is fine)
Wlodek Krakowski

Wlodek Krakowski

Experienced developer, trainer and a speaker on international conferences. Specialised in handling and refactoring legacy code. Authority in clean code, refactoring to patterns and best practices.

Register

The basic price is 3000 EUR per person for the whole workshop.

Register

Our experts offer consultations for both companies and individuals. The price is set individually.

Contact us