Showing posts with label gwt compiler. Show all posts
Showing posts with label gwt compiler. Show all posts

Dec 10, 2009

Released GWT 2.0 with Speed Tracer

GWT 2.0 new features

  • Fast edit/refresh with new development mode and draft compiles
  • Declarative UI with UiBinder
  • Pixel-perfect visuals with layout panels
  • Compiler improvements
  • Optimized resources with ClientBundle

Download GWT 2.0

Speed Tracer : http://code.google.com/webtoolkit/speedtracer/

Speed Tracer Examples : http://code.google.com/webtoolkit/speedtracer/speed-tracer-examples.html

Article : GWT Now With SpeedTracer

Video about GWT 2.0 Features :

GWT 2.0 New Features

Released GWT 2.0 with Speed Tracer

GWT 2.0 new features

  • Fast edit/refresh with new development mode and draft compiles
  • Declarative UI with UiBinder
  • Pixel-perfect visuals with layout panels
  • Compiler improvements
  • Optimized resources with ClientBundle

Download GWT 2.0

Speed Tracer : http://code.google.com/webtoolkit/speedtracer/

Speed Tracer Examples : http://code.google.com/webtoolkit/speedtracer/speed-tracer-examples.html

Article : GWT Now With SpeedTracer

Video about GWT 2.0 Features :

GWT 2.0 New Features

Sep 29, 2009

GUID - Globally Unique Identifiers

What is an GUID / UUID ?

A UUID (or GUID) is a unique identifier that can be created whithout a central authority. UUIDs can be used if a sequence number is not good enough. This implementation is thread safe and very fast.

UUID generates version 1 UUIDs that contain the the MAC address of a network card. To obtain it, the following commands are invoked and their respective output parsed:

What is it used for?

UUIDs are applied for identification purposes in a number of fields in the computer industry.

Possible uses are (but are not limited to):
  • The identifiers in the windows registry.
  • Identifiers used in databases.
  • Identifiers used in RPC (COM, CORBA) (remote procedure calls)
To ensure nobody else would - by accident - provide something conflicting.

What does it look like?

The formal definition of the UUID string representation is provided by the following :

UUIDs are basically 128 bit numbers, normally presented in the following hexadecimal - grouped form:
58e0a7d7-eebc-11d8-9669-0800200c9a66
UUID = time-low "-" time-mid "-" time-high-and-version "-" clock-seq-and-reserved clock-seq-low "-" node
time-low = 4hexOctet

time-mid = 2hexOctet

time-high-and-version = 2hexOctet

clock-seq-and-reserved = hexOctet

clock-seq-low = hexOctet

node = 6hexOctet

hexOctet = hexDigit hexDigit

hexDigit = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / "a" / "b" / "c" / "d" / "e" / "f" / "A" / "B" / "C" / "D" / "E" / "F"
In Microsoft Windows, run--> CMD--> ipconfig /all

Resources

GUID - Globally Unique Identifiers

What is an GUID / UUID ?

A UUID (or GUID) is a unique identifier that can be created whithout a central authority. UUIDs can be used if a sequence number is not good enough. This implementation is thread safe and very fast.

UUID generates version 1 UUIDs that contain the the MAC address of a network card. To obtain it, the following commands are invoked and their respective output parsed:

What is it used for?

UUIDs are applied for identification purposes in a number of fields in the computer industry.

Possible uses are (but are not limited to):
  • The identifiers in the windows registry.
  • Identifiers used in databases.
  • Identifiers used in RPC (COM, CORBA) (remote procedure calls)
To ensure nobody else would - by accident - provide something conflicting.

What does it look like?

The formal definition of the UUID string representation is provided by the following :

UUIDs are basically 128 bit numbers, normally presented in the following hexadecimal - grouped form:
58e0a7d7-eebc-11d8-9669-0800200c9a66
UUID = time-low "-" time-mid "-" time-high-and-version "-" clock-seq-and-reserved clock-seq-low "-" node
time-low = 4hexOctet

time-mid = 2hexOctet

time-high-and-version = 2hexOctet

clock-seq-and-reserved = hexOctet

clock-seq-low = hexOctet

node = 6hexOctet

hexOctet = hexDigit hexDigit

hexDigit = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / "a" / "b" / "c" / "d" / "e" / "f" / "A" / "B" / "C" / "D" / "E" / "F"
In Microsoft Windows, run--> CMD--> ipconfig /all

Resources

Inside the Google Web Toolkit (GWT)

What is the Google Web Toolkit (GWT)
  • A tool for creating AJAX sites using Java
    * Take advantage of all of the great Java tools to create AJAX applications
    * Have the maintenance advantages of Java with the deployability of AJAX
    * Build great AJAX sites without having to fill your code with special-cases to handle the different browsers
  • A debugging environment for AJAX sites
    Debug your AJAX site on your desk using the Eclipse debugging environment, no more messagebox- debugging!

What Does GWT Do
  • Compile Java into HTML, CSS, and Javascript
  • Marshal and unmarshal RPC calls
    * For this you do have to provide a server-side servlet to accept the call, but even there GWT provides some assistance.
  • Abstract the details of asynchronous calls
  • Handle browser quirks so your code stays clean
  • Handle I18n using translated message files
  • ImageBundle!
  • Handle browser history support
The GWT Java To Javascript Compiler
  • Parses the original Java code
    * Full parser, almost all Java constructs will be parsed correctly.
  • Generates a full Abstract Syntax Tree (AST) (see AST Article)
    * GWT's compiler isn't a parlor trick, it's a real code parser and cross-language compiler
  • Performs optimization, dead-code elimination, dynamic analysis, and other code fixups
    * The generated JS is fast and efficient, sometimes faster than what you might write yourself
  • Does not (yet) handle generics and erasure
The GWT AST Model
  • The AST represents each syntactic element of the Java code in a Java object
  • Implemented in package com.google.gwt.dev.jjs.ast
  • Each item is a JNode, the root is a JProgram
    * Much like DOM and Node/Document.
  • The AST also supports JSON objects
    * JSON is a first-class entity in GWT, not an afterthought
  • The AST makes extensive use of Visitor and
  • Decorator patterns
GWT Javascript Code Generation
  • Optimization
    * All code is optimized, including some unusual tricks (like turning some methods into wrapped statics)
  • Dead-Code Elimination
    * Remove any code that cannot be reached, or always returns the same value(s)
  • Javascript Generation
    * Generate Javascript, including all necessary browser-specific checks and workarounds
  • Javascript obfuscation and size reduction
    * Javascript is (optionally) obfuscated to protect your trade-secrets, and to reduce it's size
How Does GWT Native Javascript (JSNI) Work
  • The native methods are objects in the AST much as other methods are
  • When the code generation occurs, the content of the method is just copied into the Javascript
  • From there the process is no different from your Java methods
  • Much of the JDK and UI code is implemented using JSNI
How Does GWT Translate JDK Classes
  • Small subset of the Java library
    * This is growing, but not very quickly at the current time
  • Combination of Java and native Javascript
    * Some methods are regular Java code, some are native methods that just contain the Javascript in a special comment
    * It's easy to follow and understand, and it's relatively easy to add new classes
What are GWT widgets
  • A few commonly needed UI elements
    * Panels, Buttons, Dialogs, FileUpload, Tables, Forms, Listboxes, Popups, Scrollbars, etc...
    * There's also a History mechanism and a JSON client implementation
  • Created using the JSNI mechanism, just like the JDK classes
    * Feel free to create your own You can even contribute them back to the community if you want to.
How Does the GWT RPC Mechanism Work
  • You write a client class that implements RemoteService and AsyncCallback
    * RemoteService is a Marker interface (like Serializable) used as an instruction to the compiler
    * AsyncCallback enables the class to receive the response from the server
  • Write a servlet that extends RemoteServiceServlet
    * This receives the RPC and sends back the response
    * RemoveServiceServlet handles the RPC part, you handle the processing part
Summary
  • The Google Web Toolkit can make it much easier to create interactive web applications
  • GWT works by actually compiling your Java code into Javascript, with optimization and obfuscation.
  • There are facilities for History, RPC, UI widgets, and native Javascript methods
  • The code is available under an Open Source (Apache 2.0) license, you're welcome to explore.
  • The team would love to hear what you think of GWT on the GWT forum
Resources
List of Applications using GWT
Third party widgets & widget libraries

Inside the Google Web Toolkit (GWT)

What is the Google Web Toolkit (GWT)
  • A tool for creating AJAX sites using Java
    * Take advantage of all of the great Java tools to create AJAX applications
    * Have the maintenance advantages of Java with the deployability of AJAX
    * Build great AJAX sites without having to fill your code with special-cases to handle the different browsers
  • A debugging environment for AJAX sites
    Debug your AJAX site on your desk using the Eclipse debugging environment, no more messagebox- debugging!

What Does GWT Do
  • Compile Java into HTML, CSS, and Javascript
  • Marshal and unmarshal RPC calls
    * For this you do have to provide a server-side servlet to accept the call, but even there GWT provides some assistance.
  • Abstract the details of asynchronous calls
  • Handle browser quirks so your code stays clean
  • Handle I18n using translated message files
  • ImageBundle!
  • Handle browser history support
The GWT Java To Javascript Compiler
  • Parses the original Java code
    * Full parser, almost all Java constructs will be parsed correctly.
  • Generates a full Abstract Syntax Tree (AST) (see AST Article)
    * GWT's compiler isn't a parlor trick, it's a real code parser and cross-language compiler
  • Performs optimization, dead-code elimination, dynamic analysis, and other code fixups
    * The generated JS is fast and efficient, sometimes faster than what you might write yourself
  • Does not (yet) handle generics and erasure
The GWT AST Model
  • The AST represents each syntactic element of the Java code in a Java object
  • Implemented in package com.google.gwt.dev.jjs.ast
  • Each item is a JNode, the root is a JProgram
    * Much like DOM and Node/Document.
  • The AST also supports JSON objects
    * JSON is a first-class entity in GWT, not an afterthought
  • The AST makes extensive use of Visitor and
  • Decorator patterns
GWT Javascript Code Generation
  • Optimization
    * All code is optimized, including some unusual tricks (like turning some methods into wrapped statics)
  • Dead-Code Elimination
    * Remove any code that cannot be reached, or always returns the same value(s)
  • Javascript Generation
    * Generate Javascript, including all necessary browser-specific checks and workarounds
  • Javascript obfuscation and size reduction
    * Javascript is (optionally) obfuscated to protect your trade-secrets, and to reduce it's size
How Does GWT Native Javascript (JSNI) Work
  • The native methods are objects in the AST much as other methods are
  • When the code generation occurs, the content of the method is just copied into the Javascript
  • From there the process is no different from your Java methods
  • Much of the JDK and UI code is implemented using JSNI
How Does GWT Translate JDK Classes
  • Small subset of the Java library
    * This is growing, but not very quickly at the current time
  • Combination of Java and native Javascript
    * Some methods are regular Java code, some are native methods that just contain the Javascript in a special comment
    * It's easy to follow and understand, and it's relatively easy to add new classes
What are GWT widgets
  • A few commonly needed UI elements
    * Panels, Buttons, Dialogs, FileUpload, Tables, Forms, Listboxes, Popups, Scrollbars, etc...
    * There's also a History mechanism and a JSON client implementation
  • Created using the JSNI mechanism, just like the JDK classes
    * Feel free to create your own You can even contribute them back to the community if you want to.
How Does the GWT RPC Mechanism Work
  • You write a client class that implements RemoteService and AsyncCallback
    * RemoteService is a Marker interface (like Serializable) used as an instruction to the compiler
    * AsyncCallback enables the class to receive the response from the server
  • Write a servlet that extends RemoteServiceServlet
    * This receives the RPC and sends back the response
    * RemoveServiceServlet handles the RPC part, you handle the processing part
Summary
  • The Google Web Toolkit can make it much easier to create interactive web applications
  • GWT works by actually compiling your Java code into Javascript, with optimization and obfuscation.
  • There are facilities for History, RPC, UI widgets, and native Javascript methods
  • The code is available under an Open Source (Apache 2.0) license, you're welcome to explore.
  • The team would love to hear what you think of GWT on the GWT forum
Resources
List of Applications using GWT
Third party widgets & widget libraries

Sep 23, 2009

About GWT compiler

The GWT compiler is the fulcrum of GWT. The entire approach GWT takes, encapsulating browser differences and compiling JavaScript from Java, is made possible by the design and architecture of the compiler.

The GWT compiler compiles Java into JavaScript, but it’s important to understand that the compiler doesn’t compile Java the same way javac does. The GWT compiler is really a Java source to JavaScript source translator.

source : http://java.dzone.com/news/understanding-gwt-compiler

About GWT compiler

The GWT compiler is the fulcrum of GWT. The entire approach GWT takes, encapsulating browser differences and compiling JavaScript from Java, is made possible by the design and architecture of the compiler.

The GWT compiler compiles Java into JavaScript, but it’s important to understand that the compiler doesn’t compile Java the same way javac does. The GWT compiler is really a Java source to JavaScript source translator.

source : http://java.dzone.com/news/understanding-gwt-compiler

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by