I'm in the process of trying to dynamically generate a GWT wrapper for
an existing JS library and i have a few questions which come down to
best practices for the most part.

1. When wrapping a JS library with GWT, is it recommended to leave the
namespaces intact? If the JS library and the GWT wrapper library have
the same namespaces, is there a chance of a conflict where GWT code
will overwrite the original namespaces of the JS library? (i don't
think this is the case but i wanted to verify)

2. If the JS library that's being wrapped around has classes that may
need to be constructed from the Java side, then are Overlay Types
automatically out of the question (in which case plain Java wrapper
classes would be used) or is it better to still use Overlay Types and
just expose factory methods for doing the job of the constructors?

3. If the original JS library has classes where fields are commonly
accessed directly, as opposed to via getters and setters, then is it
recommended to remain faithful to the original JS library and expose
the fields without getters/setters (in which case Overlay Types are
out of the picture) or ignore this aspect of the original JS library
and expose getters/setters instead.

4. If the original JS library has a method that has optional
parameters, for example, myFunc(a, b) where b may be undefined, should
a single Java method be added, or should multiple overloaded methods
be used? For example:
myFunc(a)
myFunc(a, b)

5. Should constants be automatically converted to enumerations or
should they just be left alone?

If you have some insight on these questions (or any others i missed) i
would really welcome your input.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to