Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making GWT and Dart work together? What are the benefits? [closed]

Tags:

java

dart

gwt

I recently found out about Dart and GWT integration, (BTW, I'm a GWT developer) although I haven't had the time to view the video, I got interested in learning how to test it out with my GWT application; right now I'm looking on how to make Dart work on my GWT client side code first.

Questions:

  • When doing Dart + GWT what are the parts of the application that can be put to work together?
  • On the client side GWT and Dart can work together for both are compiled to Javascript? And regarding this part, does the Dart Browser-side access to Restful interfaces any better in terms of code maintenance?
  • Is it possible that Dart server side (bytecodes) to Run within the JVM? Or that would be very slow?
like image 379
quarks Avatar asked Mar 24 '23 06:03

quarks


1 Answers

This video and blog post (which I'm guessing is the one you mention in your question) from Shannon Behrens discusses using GWT and Dart.

  1. The following topics are covered in the video, which answers the first point in your questions.

    • Using GWT and Dart to manage different parts of the same page
    • Using Dart to retrieve JSON from a Java servlet
    • Using window.postMessage and JSNI to pass messages between GWT and Dart
    • Using JavaScript, JSNI, and Dart's js package for synchronous interoperability between GWT and Dart
    • Using CustomEvent objects and Elemental to pass messages between GWT and Dart
  2. With regards to the second question, Dart uses the same underlying AJAX APIS as JavaScript, for example, JavaScripts XMLHttpRequest is HttpRequest in Dart. Using this, you can GET / POST etc... from restful APIs.

  3. The third question "Is it possible that Dart server side (bytecodes) to Run within the JVM": Dart doesn't have bytecode. Dart on the server-side is like node.js (server-side javascript), python, ruby etc... rather than being compiled into a form of bytecode like Java. There was an early experiment to take Dart code and make it run on the JVM, but that was more an early proof of concept rather than anything for real use (ref: https://code.google.com/p/jdart/ )

like image 124
Chris Buckett Avatar answered Apr 07 '23 12:04

Chris Buckett