Refactoring

Category

Refactorings are techniques to restructure source code without changing its semantics.

Patterns

Encapsulate Field

Refactoring

Refactor a private field so that it can only be accessed using getter or setter methods. The advantage is that the accessors can be extended with additional logic without recompiling the client.

Extract Class

Refactoring

Create a new class and move the relevant fields and methods from the old class into the new class.

Extract Method

Refactoring

Extract a code fragment into a new method whose name explains its purpose. The refactoring is a way remove code comments and create small methods.