Home:ALL Converter>Accessing the remote class method to resolve cyclic dependency

Accessing the remote class method to resolve cyclic dependency

Ask Time:2018-08-23T10:33:47         Author:Vishal

Json Formatter

cyclic Dependency I am working with multimodule maven project, where I am facing the cyclic dependency between the driver(module A) and actors(module B)

Actors module has a common creation of actor system which should be common for all the actors across the project

driver uses ActorSystem to create an ActorRef for some client-side API calls hence there is a dependency of Module B on Module A. Also Actor A calls the method of driver class, which needs the dependency of Module A on Module B.

So it turns out to be cyclic dependency where Module A needs Module B and vice versa

I was looking for the solution where I could eliminate the dependency of Module A on B, as I want the Module B should not be dependent on any module. If there can be any way by which I could access the method in the driver class indirectly that could help in eliminating the cause of cyclic dependency.

Author:Vishal,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/51977595/accessing-the-remote-class-method-to-resolve-cyclic-dependency
yy