synesthesia-it / Boomerang

Swift micro-framework for MVVM (Model-View-ViewModel) native applications.
MIT License
36 stars 10 forks source link

Dependency Container #21

Closed stefanomondino closed 5 years ago

stefanomondino commented 5 years ago

We should provide a default dependency container that apps can use to separate definitions of behaviors from their concrete implementation. Example: Router allows developers to register a custom, somewhere-else-defined, route and associate a behavior to it. Usually a route should be defined in the "viewModel layer", while its behavior in the "view/router layer". This allows apps with different targets to inject different behaviors on different platforms (eg: a NavigationRoute can be modal on AppleTV and push on iOS)

Dependency containers should be as much generic as possible, and must be implemented by apps and not by boomerang. An exception to this can be the Router.