WeAreDevelopers LIVE Sep 14, 2023

I will have to refactor ! And now ? Refactoring Techniques in Java

Kamila Santos

Drowning in bloated Java legacy code? Stop letting technical debt slow your sprints. Master practical, SOLID-based refactoring techniques to build scalable, maintainable architecture.

Pause
Mute Enter Fullscreen
#1 about 3 min

Definition and primary motivations for code refactoring

Refactoring improves software design, simplifies understanding, and accelerates feature development without altering behavior.

#2 about 6 min

Strategic moments to perform code refactoring

Ideal times for refactoring include feature preparation, code comprehension, long-running improvement sprints, and code reviews.

#3 about 2 min

Potential disadvantages and risks of refactoring code

Refactoring can increase feature delivery time, cause complex merge conflicts, and require extensive test rewriting.

#4 about 3 min

Identifying code smells as indicators for refactoring

Code duplication, excessive method lengths, and outdated comments serve as primary signals that code requires improvement.

#5 about 3 min

Refactoring techniques for functions and variables

Extracting methods and variables simplifies complex expressions and groups related logic to avoid code duplication.

#6 about 3 min

Improving data access with encapsulation and parameter objects

Encapsulating public variables and grouping related parameters into objects enhances visibility control and method signatures.

#7 about 3 min

Separating distinct responsibilities using the split phase technique

Dividing complex methods with multiple processing steps into distinct functions improves readability and adheres to single responsibility.

#8 about 3 min

Restructuring responsibilities via class extraction and middleman removal

Creating new classes for specific responsibilities and removing unnecessary delegate layers streamlines object hierarchies and interactions.

#9 about 2 min

Refining method locations and removing unused code

Moving misplaced functions to appropriate classes and deleting dead code maintains relevant responsibilities and a clean codebase.

#10 about 2 min

Transforming primitive values into specific reference objects

Replacing simple value representations with dedicated reference classes allows for encapsulated validations and specialized behaviors.

#11 about 3 min

Decomposing complex conditionals and introducing assertions

Breaking down nested conditional statements and utilizing assertions clarifies decision logic and validates state during development.

#12 about 2 min

Replacing simple constructors with customized factory methods

Using static factory methods instead of basic constructors enables expressive initialization and complex attribute validation before instantiation.

#13 about 4 min

Managing inheritance through method pulling and hierarchy adjustments

Extracting common subclass methods to parent classes and collapsing unnecessary hierarchical layers prevents duplication and over-engineering.

#14 about 3 min

Combining refactoring techniques with best programming practices

Applying various refactoring methods alongside clean code and SOLID principles yields a robust and maintainable software architecture.

#15 about 2 min

Prioritizing refactoring targets in different project contexts

Selecting which code to refactor depends on whether the goal is immediate feature delivery or a dedicated improvement sprint.

#16 about 2 min

Practical benefits of isolating business validations with split phase

Extracting business rules into distinct functions enables logic reuse across the project and simplifies comprehensive method structures.

#17 about 3 min

Parameter simplification using change value to reference patterns

Grouping numerous recurring parameters into a unified reference object improves clarity and reduces method signature duplication across classes.

Matching moments

3:06 min

Refactoring legacy code bases for better environmental impact

Bjorna Kalaja · Coffee With Developers

4:11 min

Applying targeted practices to reduce waste and technical debt

Tobias Modig · LIVE

1:14 min

Utilizing design patterns as refactoring goals and communication tools

Dennis Doomen Dennis Doomen · WWC 2025

2:21 min

Five team approaches to handling engineering refactoring work

Justyna Walkowska · WWC 2023

1:53 min

Reducing accidental complications in software architecture

Nadeen Hussein Nadeen Hussein · WWC 2024

6:55 min

Understanding structural code refactorings over simple behavioral changes

Nicolas Carlo · JS Congress

Upcoming sessions on this topic

Open session

World Congress 2026 North America

When Humans Stop Writing Code: Rethinking Languages, Compilers, and Responsibility

Simon Auer

Organizer of flutter vienna meetup and CEO of marqably

Simon Auer
Open session

World Congress 2026 North America

Merging at Scale: From Broken Builds to Green Mainline

Preetam Dwivedi, Manjari Akella

Preetam Dwivedi
Manjari Akella
Open session

World Congress 2026 North America

One Repo, One Strategy: Scalable Full-Stack Testing in a Monorepo World

Bartosz Leczycki, Paweł Matynia

Bartosz Leczycki
Paweł Matynia
Open session

World Congress 2026 North America

The spectrum of agentic coding: From vibe coding to high-quality software engineering

YK Sugi

Developer Experience Manager at Eventual

YK Sugi
Open session

World Congress 2026 North America

How to generate business value through performance optimizations

Nikolai Sidiropulo

Software Engineer at Meta

Nikolai Sidiropulo
Open session

World Congress 2026 North America

Designing APIs That Survive AI Agents at Scale

Phani Pendurthi

Mastercard, Principal Software Engineer

Phani Pendurthi