Skip to content

parinaz-st/java-refactoring-catalog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java Refactoring Catalog

A structured, teaching-oriented catalog of refactoring techniques implemented in Java.

This repository is inspired by Martin Fowler’s Refactoring: Improving the Design of Existing Code (2nd Edition) and reimplements selected refactoring examples in Java.


πŸ“‚ Repository Structure

Each refactoring technique follows a consistent structure:

src/
β”œβ”€β”€ main/
β”‚   └── java/
β”‚       └── com/example/
β”‚           └── refactoring_method/
β”‚               β”œβ”€β”€ before/
β”‚               └── after/
β”‚
└── test/
    └── java/
        └── com/example/
            └── refactoring_method/
                β”œβ”€β”€ before/
                └── after/

πŸ“˜ Covered Refactorings

Examples include (growing over time):

  • Extract Function
  • Inline Function
  • Extract Variable / Introduce Explaining Variable
  • Inline Variable / Inline Temp
  • Change Function Declaration
  • Encapsulate Variable / Self-Encapsulation / Encapsulate Field
  • Rename Variable
  • Introduce Parameter Object
  • Split Phase
  • Encapsulate Collection
  • Replace Primitive with Object / Replace Data Value with Object / Replace Type Code with Class
  • Replace Temp with Query
  • Extract Class
  • Inline Class
  • Hide Delegate
  • Remove Middle Man
  • Substitute Algorithm
  • Move Function
  • Move Field
  • Move Statement Into Function
  • Move Statements to Callers
  • Replace Inline Code with Function Call
  • Slide Statement formerly Consolidate Duplicate Conditional Fragments
  • Split Loop
  • Replace Loop With Pipeline

πŸš€ Intended Audience

This repository may be useful for:

  • Students learning refactoring
  • Teaching assistants preparing lab material
  • Developers practicing safe code transformation
  • Interview preparation for software design discussions

πŸ“š Reference

Martin Fowler
Refactoring: Improving the Design of Existing Code
Second Edition

This repository is an educational reinterpretation and is not a reproduction of the book.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages