oop - How to provide specific GWT implementations -


suppose working on exposing of server-side classes gwt application, parts done better using gwt-specific components (like jsni, instance).

what techniques doing without being hacky?

for instance, aware of using subpackage , using <super-source/> tag, requires package names different, causes eclipse complain. general solution in community tell eclipse use source folder, eclipse complains there being 2 classes same name.

ideally, there way keep in single source tree, , have different classes apply alternate implementations. feel more oo approach.

i add suffix class _gwt accomplishes automatically, , know write script kind of transformation, kludge sure.

i've been considering using google's gin/guice libraries projects in general, , think there might kind of solution there, not sure have not thoroughly investigated it.

what solutions have tried in past on gwt projects?

the easiest way have split implementations use super-source code, enough instantiate uniquely-named instance or dispatch different method. ideally, super-source implementation few lines long, , not bad can't roll hand.

to work around eclipse / javac double-mapping , package name issues, gwt source uses 2 top-level roots user code: user/src , user/super. example, autobeans package has split-implementation of json quoting , evaluation, one jvm , one browser.

there's no non-kludgy way implement super-source, feature way outside can specify in language. there's nothing lets "use implementation in environment" without use of external tool.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -