Table of Contents

Extract Method

Alternative Names

Context

Purpose

Extract a portion of code from a (probably long) method into a new one in order to improve cohesion and readability of the source.

Description

Mechanics

TODO: explain mechanics

This refactoring is often automated by modern IDEs.

Origin

Reasons For Applying This Refactoring

Reasons Against Applying This Refactoring

Patterns the Refactoring May Lead to

Examples

Description Status

Stub

Further Reading

Discussion

Discuss this wiki article and the refactoring on the corresponding talk page.