Rodi API approaches: ContainerProtocol vs Concrete Implementation
mainRodi provides two distinct API approaches depending on your architectural needs:
ContainerProtocol (Generic API): Use this when you want to maintain flexibility to swap
rodiwith other dependency injection implementations. The protocol requires a class to implement three specific methods:register: To register types.resolve: To resolve types.__contains__: To check if a type is configured. If using another library, you can use composition to wrap it in a class that implements this protocol.
Concrete Implementation: Use this when you want a direct, specific implementation and do not intend to switch DI libraries.