# Code Smell 321 - Getter Piggybacking

DevFeed: [Code Smell 321 - Getter Piggybacking](<https://devfeed.tech/articles/code-smell-321-getter-piggybacking-18228.md>)

Original publisher: [Read original article](<https://maximilianocontieri.com/code-smell-321-getter-piggybacking>)

Author: Maxi Contieri

Published: 2026-08-20T02:51:49Z

Content type: article

Language: en

Sources: [Maximiliano Contieri - Software Design](<https://devfeed.tech/sources/maximiliano-contieri-software-design.md>)

Topics: [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [business-logic](<https://devfeed.tech/tags/business-logic.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>)

## AI overview

This article explains a code smell in which an existing getter is reused to implement business logic outside the object that owns the value. It describes the resulting duplicated rules, broken encapsulation, scattered comparisons, and fragile refactoring, and recommends adding behavior methods, keeping comparisons inside the object, passing collaborators instead of primitives, and using getters mainly for rendering.

## Source excerpt

TL;DR: Don't reuse an existing getter to bolt on new business logic from outside the object. Problems 😔 Duplicated business rules Broken encapsulation Scattered comparison logic Hidden domain kn