-
Notifications
You must be signed in to change notification settings - Fork 1
SPIR
Adam Share edited this page Oct 5, 2020
·
9 revisions
App architecture utilizing Lifecycle
to create a scoped business logic tree independent of the view hierarchy.
Presenter |
ViewLifecycleOwner that provides a View to the parent scope and can be referenced as an ObservableObject by the returned view. |
Interactor |
LifecycleOwner that contains business logic and optionally a strong reference to a Router and Presenter. |
Router |
LifecycleDependent that encapsulates and generalizes routing logic between scopes. |
-
Router
is optional because theScopeLifecycle
is owned by theInteractor
which manages both lifecycle state and attaching child scopes. -
Router
does not have a circular reference to anInteractor
and instead instantiates with the sharedScopeLifecycle
as aLifecycleDependent
enabling it to also conform toLifecycleOwnerRouting
. -
Worker
is no longer needed since anInteractor
can encapsulate business logic as a child of anotherInteractor
. -
Presenter
Interactor
andRouter
logic can live in onePresentableInteractor
to start and refactor as you scale up. -
Builder
classes are provided as a convenience for type erasure without requiring subclassing keeping leaf scopes lightweight.