Por que o seu código deveria falar a mesma língua do seu negócio (e não do seu framework)
Quando você modela os métodos de uma classe chamada CheckingAccount , o que você escreve? get_current_balance() , check_pending_transactions() e approve_limit_increase() ? Isso pode soar natural enquanto você está imerso na IDE. Mas tente explicar para um gerente de produto ou analista de operações que um bug crítico está na função is_bank_ticket_paid() . Ou pior: observe a cara deles durante uma…
When crafting methods for a class named CheckingAccount, you might write get_current_balance(), check_pending_transactions(), and approve_limit_increase(). Those method names sound natural while you're working within the IDE. However, trying to explain a critical bug in the is_bank_ticket_paid() function to a product manager or operations analyst can be challenging.
Worse, imagine the confusion on a daily standup or technical review as team members try to decipher the jargon engineering invented to represent processes they've operated on for years. It may seem like a mere aesthetic issue, but the gap between business terms and coding syntax incurs high costs over time. The mental translation cost Consider this scenario: during a refinancing session about loan approval, domain experts use terms like approve credit, check limits, and classification.
Meanwhile, engineering must mentally map those concepts throughout the meeting: approve credit becomes approve_customer_credit(), check limits becomes check_account_credit_limits(), and classification becomes check_classification(). Each layer of translation adds friction, noise, and room for conceptual bugs (where code runs perfectly but performs the wrong business rule).
Shouldn't everyone speak the same language? This is where the Ubiquitous Language from Domain-Driven Design comes in. It eliminates the intermediary: the terms used in the code should reflect the actual domain vocabulary. If you're at a Brazilian credit cooperative, it doesn't make sense to have Customer and active_member() if the domain speaks of Associado and associado_ativo.
Note: Ubiquitous Language isn't just grabbing loose industry jargon and slapping it into code without regard. It's a two-way street. Often the business team uses ambiguous or inconsistent terms. It's up to engineering to investigate: what formally defines an active associate? What happens in the classification step? When the technical team challenges definitions, and business delivers precise terms, the final model is built collaboratively and rigorously.
The same term, different meanings: the danger of God Classes In DDD, the Ubiquitous Language gains real traction when it respects Bounded Contexts. The classic mistake is trying to create a global entity to reuse everything, resulting in a classic God Class. Imagine a financial cooperative with three clear contexts: Insurance, Credit, and Investments.
While the same CPF is the same physical person, in the Credit context they care about income, borrowing capacity, and credit score. In the Insurance context, they care about health history, active policies, and risk profile of the asset. In the Investments context, they care about investor profile (suitability), allocated capital, and desired liquidity.
Does it make sense to have a single Associado entity with dozens of methods and attributes, where each context only consumes a fraction of them? Obviously not. Instead, the Ubiquitous Language should reflect the specific context: In the insurance context, you model the Segurado (Insured). In the credit context, you model the Tomador (Borrower).
In the Investments context, you model the Investidor (Investor). Each class encapsulates only the behavior and data strictly necessary for its boundary. Even if some basic registration data repeats across persistence, the conceptual model stays clean, decoupled, and immune to cascading changes—tweaking a policy rule won't risk breaking credit scoring calculations.
Conclusion Adopting a legitimate Ubiquitous Language isn't a matter of fancy terminology or architect pedantry. It's a decision that shortens the feedback loop between rule creators and implementers, reduces dependence on endless alignment meetings, and protects the architecture from unnecessary couplings. Code ceases being a labyrinth of technical abstractions and becomes the living documentation of the business itself.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.