My real love for GWT started only a couple of days ago… and it prompted me to get started with Dojo on GWT.
I have, so far, written a couple of core-classes in Java mainly to abstract out the interaction with JavaScriptObject.
My next target was to directly jump on to dijit, and start creating the UI. And then I realized that it uses mixins. And now I am left wondering what’s the best way to handle mixins.
For the new comers, JavaScript allows single inheritance but Dojo (and other libraries) make use of mixins to pseudo-inherit methods and properties from other objects by copying them to the sub-object.
In Java, this can be achieved only by making use of interfaces. The other possibility is to introduce a class between the parent and the child class that encapsulates the mixin objects.
I think the latter is a better approach. Simply expose the object or may be create delegate methods.
Let me think over it… what’s the best way to marry Java and JavaScript.
Leave a Reply