I am looking into making a Dart application that will have the domain classes defined on both the server and the client. I will use Dart serialization ( http://api.dartlang.org/docs/releases/latest/serialization.html ) to send/receive the objects. My question is about how I should do the communication between client and server:
Is “web sockets”
the preferred communication method? I briefly looked the example below, but I
think it will no longer work in the latest version:
https://www.dartlang.org/docs/dart-up-and-running/contents/ch05.html
Should I dig into the code and try to update it, or is it a dead end? Maybe it is only Dart UI changes, which makes this example no longer valid?
Are there other frameworks / techniques that are preferred over “web sockets”?
Kind regards,
Runar
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
You could check out google's proto buffers, the dart lib was released earlier this week.
Jim: Yes, the client is a web application running on the public internet. Therefore, the connection also needs to be secure. I am not sure if I really need the connection to be persistent. I guess I started looking at “web sockets”, since they allow two-way communication, which would be a plus.
After
browsing a bit more, I found the article below about REST and Dart. I should
probably ready it, although as far as I understand, REST will not allow
the server to “push” messages to the client.
https://www.dartlang.org/articles/json-web-service/
Frank: Correct me if I am wrong, but I thought Protocol Buffers would pretty much work like a REST API: It would not allow for pushing messages from server to client.
Runar
--