← Graph

Is the sufficient-funds check a feature envy smell?

question 2 connections

Audience member (citing 'tell don't ask') objects that the handler asks the account if there are sufficient funds, then decides what to do. Ladd argues encapsulation can be taken too far: the if/else decides which message to write (withdrawn vs withdrawal declined), and that is a messaging concern belonging in the handler. The entity legitimately exposes a yes/no query. For more complex outcomes Eventide has no prescribed solution — it's up to the programmer to manage that complexity.

answer_summary
The conditional belongs in the handler because deciding which event to write is a messaging concern; a query method on the entity is fine.
question Is the sufficient-funds check a feature envy smell?
about
Command Handler concept
Answer argues the decision belongs in the handler, not the entity.
question Is the sufficient-funds check a feature envy smell?
asked_at
Q&A after the talk.

Provenance

Read by
4 extractions