Home

Interactors

An interactor is a software component that encapsulates the execution of a specific use case, implementing the application's business rules and coordinating the flow of data between the user interface, data stores, and domain entities. In many modern architectures, including Clean Architecture and VIPER, the interactor is the implementation of a use case and sits between the UI layer and the data/domain layers.

Typically, an interactor receives input from the presentation layer through a request or input boundary, validates

Interactors are often designed to be stateless with respect to a single use-case invocation, though some use

Terminology varies by framework. The term "use-case interactor" or "application service" is common, and in VIPER

and
applies
business
rules,
delegates
data
retrieval
and
persistence
to
gateways
or
repositories,
and
constructs
a
result
to
be
delivered
to
the
presentation
layer
through
an
output
boundary
or
presenter.
It
should
remain
independent
of
UI
details
and
framework
concerns,
enabling
straightforward
testing.
cases
may
retain
session-like
state
during
the
execution.
They
rely
on
domain
entities
to
enforce
invariants,
and
on
gateways
or
repositories
to
interact
with
persistence
or
external
services.
By
separating
orchestration
from
UI
and
data
access,
interactors
help
maintain
separation
of
concerns
and
improve
testability.
the
interactor
focuses
on
business
logic
while
presenters
handle
presentation
formatting.
Outside
software
architecture,
"interactor"
can
be
used
more
generally
to
refer
to
any
component
that
participates
in
an
interaction
between
a
system
and
a
user
or
other
systems,
but
in
most
technical
contexts
it
denotes
the
use-case
implementation.