We're developing an Yii2 php appliction, which can be seen as a AirBNB clone for sake of simplicity. I'm trying to devide the application into modules, but keep getting ugly dependencies no matter how I twist or try. Couple of examples:
- There is a booking and an item module, when displaying an item, the booking module is also to be used to disable dates when an item is already booked.
- On the confirm booking page, a credit card form is implemented which belongs to the payment module, which couples the modules really tightly.
- The homepage should display items, which depend on the item module for generating the right image url's etc.
How can we keep this kind of things decoupled?