Registry
Services registry for decoupling SDK components Acts as a very basic Service Locator for internal SDK dependencies
Core dependencies are defined as properties for ease of access. Dynamic dependencies can be defined and fetched with the add/get methods. At this time I treat all our services as singletons
Technical note on the dynamic registry methods:
noinline keyword allows us to store the Registration lambdas
inline methods make it possible to use generics properly here
@PublishedApi is required so that the inlined methods can read/write to private registry without leaving the type-erased methods fully public
Functions
Query whether a service of type is already registered
Register a service for a type, specified by generic parameter Typical usage would be to register the singleton implementation of an interface
Lazily register a service builder for a type, specified by generic parameter Typical usage would be to register a builder method for the implementation of an interface