I'm trying to fully understand how modules DI works and I'm struggling with one thing.
I have sample app:
-- API MODULE
- all controllers here
-- USER MODULE
- APPLICATION MODULE
- DOMAIN MODULE
- INFRASTRUCTURE MODULE
-- CARD MODULE
- APPLICATION MODULE
- DOMAIN MODULE
- INFRASTRUCTURE MODULE
-- GENERAL APP MODULE
Two things:
- I want to create interface in USER MODULE to be implemented in INFRASTRUCTURE MODULE. But I don't want to import infra into domain. It makes no sense. Instead I want to bind it somewhere else but can't figure out how to make it work. It complains that USER DOMAIN MODULE can't see implementation of interface (through symbol)
- Second thing is - I don't want to mix modules. So if I need to access USER from CARD I don't want to simply import whole user domain. I want to create some interface on CARD site and then add some "client implementation" on user site and bind it somewhere. But I have the same complaints as in previous example.
So where should I bind those "cross modules dependencies"?