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