Posts

Showing posts from September, 2011

OO Limits of GWT and why GWT is not Java

In GWT to achieve inheritance of UI elements, using the @UiChild annotation is encouraged. But using this technique also makes it impossible to use classic Java inheritance within Composites (Widgets) which apply the @UiChild pattern. As P resenter and V iew elements (M VP ) are necessarily mixed in your *.java files, you can't apply Java's OO inheritance pattern to the Presenter logic as well, or at least GWT makes it unnecessarily complicated to do this. Applying Java's inheritance model leads to a significant increase of the re-compilation time (turnaround time) in GWT's Developer Mode. All these has a huge impact on code re-usage which isn't possible as well as it would be, when GWT would make it easier to apply Java's classic OO inheritance. ...waiting for Dart to bring a significant improvement to GWT in this respect!

Error 503: Cannot deploy app to GAE

If you can't deploy an app to a Python or Go instance and getting the following error: Application: vel-loxal; version: a Host: appengine.google.com Starting update of app: vel-loxal, version: a Scanning files on local disk. Cloning 35 static files. Cloning 86 application files. Compilation starting. Error 503: --- begin server output --- Try Again (503) An unexpected failure has occurred. Please try again. --- end server output --- Rolling back the update. Error 503: --- begin server output --- --- end server output --- ...it's maybe because you're uploading a static-only app (maybe a GWT frontend?), an app without any executable files. So you should disable appcfg.py's pre-compilation : appcfg.py update --no_precompilation target/artifacts/GWT-only/

Actual facts about Google Dart / Dash

There is much FUD on the web about Google's new "structural programming language" called Dash/Dart. Actually it is called " Dart " and there is an official internal introduction mail that has been leaked by Google. In this mail you can read what Dart actually is ( and what it is not : "A JavaScript killer!" ) and how Google intends to incorporate existing technologies like Closure, GWT, JS++, Joy, JSPrime, JSCompiler and last but not least, JavaScript itself in Dart . Also you can read about Dart's relation to Android and Go. Here is a copy of the above mentioned mail: ---------- Forwarded message ---------- From: Mark S. Miller Date: Tue, Nov 16, 2010 at 3:44 PM Subject: "Future of Javascript" doc from our internal "JavaScript Summit" last week To: java...@google.com On November 10th and 11th, a number of Google teams representing a variety of viewpoints on client-side languages met to agree on a common vision for the fut

The future of GWT is going towards Dart

What is the future of the JSCompiler and GWT? JSCompiler and GWT were already on a merger path. This effort gives us a direction for that unification around the Dash language. We will actively support teams for a long time on the current generation of JSCompiler and GWT and provide fantastic co-existence and migration tools to Dash. We intend for existing Google teams using GWT and JSCompiler to eventually migrate to the Dash compiler. -- Google

JavaScript distinguishes between values and objects

In Java Integer is an object and int is a primitive type (a plain value), that can be converted to the Integer object using Java's auto-boxing capability. JavaScript is similar: Executing the following in Chrome's Developer Tools JavaScript console, will show you the difference between an object and a number in JavaScript: typeof 1 " number " typeof new Number(1) " object " 1 instanceof Number false new Number(1) instanceof Number true So you see that var myNum = 1; isn't the same as var myNum = Number(1); .

Maven configuration for RequestFactory & GWT

<dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>${gwt.ver}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.web.bindery</groupId> <artifactId>requestfactory-apt</artifactId> <version>${gwt.ver}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.web.bindery</groupId> <artifactId>requestfactory-server</artifactId> <version>${gwt.ver}</version> </dependency> ...is the bare minimum dependency configuration you need. The scopes are set as narrow as possible. Here you can read about the background of this configuration .

Deleting a remote branch in Git repository

git push orign :your_remote_branch_name_to_delete ...pushes "null" to the respective remote branch and deletes it therefore.

Remove the "Top Stories" section from the Google News page

If you want to get rid of the "Top Stories" part in Google News, you can use this Chrome extension to do so.

Generics in Java — a summary for beginners

class Container <T> { private T type ; void add( T type ) { this. type = type ; } T get() { return this. type ; } } T is a Generic, aka formal type parameter aka type variable . Generics are also applicable to interfaces. They are used to reduce the scope of the (in this case) t variable. Also you can spare explicit castings which you may need without using Generics. If you omit <T> in the class declaration, you could put any Object in place of t. But so the class would be too specific. On the other hand if you don't specify the exact type of t and use Object instead of T , the code might throw Exceptions at runtime. So you can't catch syntactical error at compile time. Generic type invocations are instations of classes that use Generics: Container<Integer> containerOfInteger; // that's how you read it, but you may write "stringContainer" As you see I'm using the Object Integer inste