I have a question about a mediator template that I want to implement in my application (using C #). When implementing the template in my code, I came across a circular dependency. The structure of the classes is as follows:
Mediator and Colleague components / classes are in different assemblies, and as a mediator template, it is required that both components (classes) use each other. The problem occurs when referring to each other.
Consider the code below:
namespace Mediator { public abstract class IMediator { public IColleague colleague{get;set;} void Register(); void Send(); } public class MediatorA:IMediator { void Register(){
namespace Colleague { public abstract class IColleague { IMediator mediator; void Send(); void Recieve(); } public class ColleagueA:IColleague { void Send(){
how Mediater and colleague are in different namespaces and nodes, how to resolve circular dependency?
Geekm source share