I remember long time ago I came across a very interesting framework which was Echo2, the very concept of writing for me was brilliant, but a closer examination, however, the solution I found that in practice it has little chance of success. Now nadeszedł moment when I decided to compare it with GWT, because the very idea of \u200b\u200bwriting applications in these frameworks is similar, but basically completely different.
as both GWT and Echo2 developer uses the API similar to the Swing (or those who prefer to AWT). Below is an example zamieszony how to add and edit field button in the Echo2:
final TextField text = new TextField ();
text.setText ("Empty value");
final Button button = new Button ();
button.setText ("Complete");
button.addActionListener (new ActionListener () {public void actionPerformed
(ActionEvent event) {
text.setText (Supplemented by value ");}
}
Window window = new Window ();
window.setContent (new ContentPane ());
window.getContent.add (text);
window.getContent.add (button); In this same example GWT looks like this: final TextBox text = new TextBox ();
text.setText ("Empty value");
final Button button = new Button ();
button.setText ("Complete");
button.addClickListener (new ClickListener () {public void onClick
(Widget sender) {
textField.setText (Supplemented by value ");}
}
RootPanel.get (). Add (text);
RootPanel.get (). Add ( button); Regarding the comparison of code, there is no essential difference in operation while the situation is different. GWT from Java code generates the JavaScript that runs in your Web browser, the Echo2 code compiles to Java classes, and then executes it on the server. This makes each event (eg button pressed) generates traffic between web browser and the server. Wybraźmy yourself what would happen if every time you exit the edit box has been running the event (Echo2 fortunately limited run such events.) Hence the approach proposed by Echo2 totally does not appeal to me, because I generate too much traffic on the network. Obviously there are certain advantages of this approach such as the server knows what is the status of the application is sent only necessary JavaScript.
GWT developers have chosen according to me, more natural way, since the interface is a browser and the application is run in it, and communicates with the server only when necessary.
0 comments:
Post a Comment