# Extract Function

> A technique for moving a fragment of a long function into a named function of its own.

Record: `lexicon:extract-function`
Kind: technique
Layer: [Structural Core](https://banes-lab.com/records/layer/structural-core.md)
Canonical: https://banes-lab.com/ontology/lexicon#lexicon-extract-function

Listed in [Lexicon terms](https://banes-lab.com/api/records/lexicon.md), after [Move Behavior to Its Owner](https://banes-lab.com/records/lexicon/move-behavior-to-its-owner.md) and before [Split Method](https://banes-lab.com/records/lexicon/split-method.md).

## Category

- [Core Modular Design](https://banes-lab.com/records/lexicon-category/core-modular-design.md)

## Refactors

- [Do Not Repeat Yourself](https://banes-lab.com/records/architecture/duplicate-code.md)
- [Encapsulation](https://banes-lab.com/records/architecture/encapsulation.md)

## Linked from

- [Core Modular Design](https://banes-lab.com/ontology/principles/architecture-category-core-modular-design.md)
