I've a multi-module GWT project and I'd like to use ServiceLocators. I have 3 modules:
- "client" depends on shared
- "shared"
- "server" depends on shared
I wrote the ServiceLocator like this:
public class TreeServiceLocator implements ServiceLocator {
public Object getInstance(Class<?> clazz) {
return new TreeService();
}
}
and placed this class in the "shared" module because ServiceLocator has the package com.google.gwt.requestfactory.shared. However, when I compile this throws an error because TreeService is implemented in the "server" module since I need it to return beans from the server and interact with Spring, etc.
In which module should I implement the TreeServiceLocator? Also, maven will throw a circular dependency error if I try to include "server" from the "shared" module.
Thank you!