Software Design: Tidy First?

TT? Chapter: Fields Object

Kent Beck's avatar
Kent Beck
Jun 16, 2024
∙ Paid
11
7
Share

Pattern

You see the same set of fields in several objects.

Forward

Group the fields into a single object. Give the fields of the object the names (& types, if applicable) of the fields. Replace the original fields with an instance of the fields object.

Example

Time intervals or periods are a common example. If you see classes like this:

Contract
validFrom, v…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Kent Beck
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture