Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

The GWT Components

In this section we will discuss the three basic components of GWT: the high-quality Java-to-JavaScript compiler, the Java Runtime Environment (JRE) Emulation library, and the User Interface (UI) library. If you were used to previous versions of GWT (up to 1.7) you may be missing the “hosted browser” that enabled you to try out code in hosted mode, but GWT now uses “in browser development” (and development mode) that enables you to directly test your application on your own browser, as we’ll see in Chapter 3, “Understanding Projects and Development.”[8]

[8] This “in browser” mode was, at least for a while, called OOPHM, standing for Out Of Process Hosted Mode.

Compiler

The first and most important component of GWT is the Java-to-JavaScript compiler. It takes your Java 1.5 code and produces distinct equivalent JavaScript versions that can be run on all supported browsers: At the time of writing, all versions of Safari and Firefox, Opera (at least up to versions 9.x), and versions 6 to 8 of Internet Explorer—Google Chrome, being based on the same layout engine (WebKit) as Safari, is also supported and runs Safari’s code.[9] (Actually, the number of generated versions of the JavaScript code can be far larger, if your application uses i18n—internationalization—as we’ll study in Chapter 12, “Internationalization and Localization.”) Code can be minimized for size, for faster downloads; there are also facilities for code splitting, which lets you download the required JavaScript code in smaller pieces, on a when-required basis; see Chapter 15, “Deploying Your Application,” for more on this.

[9] There are many other browsers (some for cell phones) that are also based on WebKit and thus could run GWT applications; check http://webkit.org/ for more details.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint