Search⌘ K
AI Features

Using Domain Entities as an Input or Output Model

Explore the implications of using domain entities as input or output models in incoming ports. Understand when this approach is suitable for simple use cases and why complex domain logic requires dedicated models to avoid unintended dependencies. Learn to recognize when to consciously replace shortcuts to maintain clean and adaptable software architecture.

If we have an Account domain entity and an incoming port SendMoneyUseCase, we might be tempted to use the entity as the input and/or output model of the incoming port, as the figure below shows:

Using domain entities as input model

The incoming port has a dependency to the domain entity. The consequence of this is that we’ve added another reason for the Account entity to change. ...