I assume this is a general question, but I will try to describe my current problem.
I have a basic service, let's call it "CoreService", which provides that I would say "basic" functions: process data in the database (we have a centralized database in our applications). There are a number of other applications, some of which have their own database for local purposes. And there is one simple "NotificationService". Its purpose is to send messages to various subscribers.
Usually this NotificationService is called from "ExternalWorld" and sends notifications to various services (among them "CoreService").
Today I saw the need to name "NotificationService" from "CoreService".
It bothers me that I introduced a cyclical dependency: NotificationService should know how to send messages to each service (including "CoreService", so it needs to know about the "CoreService" interface, and as a result, it needs to refer to "CoreService") and "CoreService" must send messages to the "NotificationService" (so it also needs to be referenced) ... Circular dependency ...
Question: How should we build our architecture to solve this problem?
Thanks a lot!
Budda source share