-
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. |
-
Routeris optional because theScopeLifecycleis owned by theInteractorwhich manages both lifecycle state and attaching child scopes. -
Routerdoes not have a circular reference to anInteractorand instead instantiates with the sharedScopeLifecycleas aLifecycleDependentenabling it to also conform toLifecycleOwnerRouting. -
Workeris no longer needed since anInteractorcan encapsulate business logic as a child of anotherInteractor. -
PresenterInteractorandRouterlogic can live in onePresentableInteractorto start and refactor as you scale up. -
Builderclasses are provided as a convenience for type erasure without requiring subclassing keeping leaf scopes lightweight.