Assume:
I have a Java/Android modular library that can setup like this:
package com.mycorp.app.sample.integration;
public class ModuleConnector {
public static final LogcatLogger LOGCAT_LOGGER
= new LogcatLoggerImpl.Configurator("TEST")
.verbosity(LogcatLoggerImpl.Verbosity.VERBOSE)
.replace("ApiDesign", "Design")
.replace("Sample", "Sample")
.createInstance();
public static final JsonWebservice GET_INFORMATION_WEBSERVICE
= new JsonWebserviceImpl.Configurator()
.logger(LOGCAT_LOGGER)
.enableCaching(true)
.endpoint("http://test.com")
.createInstance();
}
Problem:
Current dependency diagram shows:
after adding this code shows below
package com.mycorp.app.sample.global;
public class G extends Application {
static {
ModuleConnector.GET_INFORMATION_WEBSERVICE.request(null);
}
}
I want to prevent marked dependency:
Notes:
ModuleConnector
is incom.mycorp.app.sample.integration
packagecom.mycorp.app.sample.global
can be every client side package.- I want to use
com.mycorp.app.sample.integration
to access module apis - I have alot of api methods, so i prefer to don't use from
Command/Strategy pattern