r/SpringBoot • • Apr 17 '26

Question Spring Modulith loose coupling

Hello to those who use Spring Modulith, I don't know what's the correct approach on my problem because AI suggested different approach and other docs/github discussions aswell. The problem is about read heavy queries, for example is Booking and Payment module, when making a Booking, if making a payment record then use events. But when i want to view my booking I want to show both my booking and payment info (status, payment method, etc) I thought of making a top-level dto on payment module and let Booking module call payment's public interface for info but then i also thought of possible circular dependency soon. What's your solution to this? It can be anything not just Booking/Payment example.

EDIT: A separate table(combining both) sounds like a good solution OR a join but in separate module, what are y'all thoughts?

8 Upvotes

17 comments sorted by

View all comments

Show parent comment

2

u/Character-Grocery873 Apr 18 '26

Sounds good, I will take a look on tanstack when i have the time then, thank you for your time