All the tools I wrote I looked at the docs and wrote each methods by hand.
Sometimes I even ran the code to see what type the method expects since some methods are not documented at all. Digging inside JS frameworks is an interesting adventure.
I ve seen some nasty things :)
Hard work I agree. But This gives me a better understanding of the libraries I m wrapping.
This also gives me the chance to make the API more javaish.
If you are going to taylor the tool afterward you will have to go through the entire library anyway to make sure all methods are corrects.
2013/12/11 David Hoffer <dhoffer6@gmail.com>
How do you handle that same case when writing the wrapper manually? Do you manually inspect the method to see what are allowed types and then define the java wrapper appropriately? Or do you just go with Object and let the user of the wrapper code figure out what is allowed? Again, this might be naive as I haven't tried to write a tool but I think I'd be okay with the tool just using Object to start with then it would be great if the tool allowed me to customize/tailor the type mapping once it's known what the allowed types are. Not sure how that would be accomplished as one probably can't add comments/annotations to existing library code. I'd love to see what the SWIG folks think about this there the experts on this sort of thing (I did post a message there).-DaveOn Wed, Dec 11, 2013 at 12:19 PM, Jens <jens.nehlmeier@gmail.com> wrote:
For example take the following JS codefunction doSomething(o){}How would a tool what the type of o is. Object ? Number ? String ?That's what I thought too and I think thats the reason why such a tool does not exist. JavaScript is too dynamic to make such code generation work reliably.
-- J.--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/GkvZUIs2knY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment