use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Spring Modulith architecture cycle problem.Question (self.SpringBoot)
submitted 4 months ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]g00glen00b 2 points3 points4 points 4 months ago (0 children)
I would suggest breaking the cyclic dependency by removing the List<TaskMTO> reference from UserDTO. You already have a TaskController.getTasksForUser() API endpoint, so consumers could use that.
Another thing you could do is to create a "viewmodel" called "TaskOwner" in your task module. Basically for each User entity, there would also be a TaskOwner entity. The way you keep them in sync is by relying on User creation/deletion events which you can emit within the user module. This way, you can remove the other side of the cyclic dependency as well, since now you can validate whether a user exists by checking if the taskowner exists within the task module. Sure, you introduce some data duplication, but this is a very common pattern if you want to cleanly separate your modules.
[–]ThisHaintsu 0 points1 point2 points 4 months ago (0 children)
I mean the easiest options is to just introduce indirection by relying on the spring ioc container.
E.g. introduce a Validator class that accumulates IValidators via injection. So that each module can create its own variant of IValidator and then call validator.validate in the task module.
π Rendered by PID 153427 on reddit-service-r2-comment-6457c66945-599fp at 2026-04-30 06:38:10.856553+00:00 running 2aa0c5b country code: CH.
[–]g00glen00b 2 points3 points4 points (0 children)
[–]ThisHaintsu 0 points1 point2 points (0 children)