Skip to content

How to communicate between modules (avoiding circular dependency with good architecture) #90

Answered by Sairyss
carmona44 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not exactly sure from your explanation how you got circular dependencies and how hasRead flag is related to circular dependencies that you get, will need more context.

how can a flag (e.g. "hasRead") be returned by a book query to indicate that a book has been read by the logged-in user

You can have one endpoint (command) to set book as read, and another one like getBooks (query) that returns a list of books where you join book and user_book and return it.

Also, book and user_book are part of the same bounded context and can be a part of a single module, I don't see much sense separating them. If you have 3 tables it doesn't mean you need 3 modules, you are just creating modules tha…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@carmona44
Comment options

@Sairyss
Comment options

@carmona44
Comment options

@Sairyss
Comment options

@carmona44
Comment options

Answer selected by carmona44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants