Kamila Santos
I will have to refactor ! And now ? Refactoring Techniques in Java
#1about 2 minutes
What is refactoring and why is it important
Refactoring improves software design and makes code easier to understand without changing its external behavior.
#2about 6 minutes
Identifying the right moments to refactor code
Refactoring can be done preparatorily, for understanding, to remove dead code, as a long-term project, or ideally during code reviews.
#3about 2 minutes
Understanding the disadvantages of refactoring
While beneficial, refactoring can increase delivery time, cause merge conflicts, and require tests to be rewritten.
#4about 2 minutes
Recognizing common code smells in your codebase
Code smells like duplication, long methods, confusing names, and outdated comments indicate underlying problems that refactoring can fix.
#5about 3 minutes
Using extract function and extract variable techniques
Improve readability by grouping code into a new function or simplifying complex expressions by storing them in a descriptive variable.
#6about 3 minutes
Encapsulating variables and introducing parameter objects
Control data access by making variables private with getters/setters and simplify method signatures by grouping related parameters into a single object.
#7about 3 minutes
Breaking down complex methods with split phase
Decompose a method that performs multiple distinct tasks into separate, more focused methods to improve clarity and maintainability.
#8about 4 minutes
Simplifying class interactions and responsibilities
Refactor large classes by using extract class, remove unnecessary intermediaries with remove middle man, and move functions to more appropriate classes.
#9about 4 minutes
Cleaning up code with various refactoring techniques
Improve the codebase by removing unused code, changing value objects to references for shared identity, and decomposing complex conditional logic.
#10about 5 minutes
Improving object creation and class hierarchies
Replace simple constructors with flexible factory methods, move common methods to a superclass with pull up method, and simplify hierarchies by collapsing unnecessary layers.
#11about 2 minutes
Conclusion and key takeaways on refactoring
Refactoring techniques should be combined and used alongside principles like SOLID to solve specific problems and improve overall code quality.
#12about 6 minutes
Q&A: Prioritizing refactoring and specific techniques
The speaker answers questions on how to prioritize refactoring tasks, the benefits of the split phase technique, and when to use change value to reference.
Related jobs
Jobs that call for the skills explored in this talk.
tree-IT GmbH
Bad Neustadt an der Saale, Germany
€54-80K
Intermediate
Senior
Java
TypeScript
+1
MARKT-PILOT GmbH
Stuttgart, Germany
Remote
€75-90K
Senior
Java
TypeScript
+1
Matching moments
03:16 MIN
Improving the developer feedback loop with specialized tools
Developer Time Is Valuable - Use the Right Tools - Kilian Valkhof
02:55 MIN
Why developers often undervalue their time and paid tools
Developer Time Is Valuable - Use the Right Tools - Kilian Valkhof
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
02:33 MIN
Why you might not need JavaScript for everything
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
11:32 MIN
The industry's focus on frameworks over web fundamentals
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
04:56 MIN
Recreating React components using AI and dev tools
WeAreDevelopers LIVE – AI, Freelancing, Keeping Up with Tech and More
03:58 MIN
Making accessibility tooling actionable and encouraging
Developer Time Is Valuable - Use the Right Tools - Kilian Valkhof
03:07 MIN
Final advice for developers adapting to AI
WeAreDevelopers LIVE – AI, Freelancing, Keeping Up with Tech and More
Featured Partners
Related Videos
Keep your code refactorable
Gerrit Stapper
OOP revisited
Dominik Przybysz
Application Modernization Leveraging Gen-AI for Automated Code Transformation
Syed M Shaaf
Identifying code smells
Benjamin Bischoff
Dirty Tests And How To Clean Them
Gil Zilberfeld
Product Managers' Eternal Battle with Refactoring
Justyna Walkowska
Java with a Clojure mindset
Dan Lebrero
From boy scouting to redrawing the landscape
Tim te Beek
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.


Finanz Informatik
Frankfurt am Main, Germany
Senior
Java
Spring
JavaScript

Wilken GmbH
Ulm, Germany
Remote
Senior
Java
Docker
Quarkus
PostgreSQL
+1




Code Healers LLC
Hinesville, United States of America
Remote
€30-40K
Intermediate
Senior
.NET
React
JavaScript
+2

Code Healers LLC
Hinesville, United States of America
Remote
€20-30K
Junior
Intermediate
React
JavaScript
TypeScript
+1

Visonum GmbH
Remote
Junior
Intermediate
React
Redux
TypeScript