Software Design: Tidy First?

TT? Chapter: Fields Object

Kent Beck's avatar
Kent Beck
Jun 16, 2024
∙ Paid

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…

User's avatar

Continue reading this post for free, courtesy of Kent Beck.

Or purchase a paid subscription.
© 2026 Kent Beck · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture