[GWT] 自學GWT - 1

GWT已經Release很久了,現在才開始熟悉它好像有點慢XD
不過"亡羊補牢、猶時未晚",有開始總是好的嘛!對於我這個Google-addicter來說,當然要去了解一下GWT的用法囉! 廢話不多說,開始吧。

先來了解一下什麼是GWT。根據Google官方的解釋:
Google Web Toolkit (GWT) makes it easier to write high-performance AJAX applications. You write your front end in the Java programming language and GWT compiles your source into highly optimized JavaScript. Writing web apps today is a tedious and error-prone process. You spend 90% of your time working around browser quirks, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile. It doesn't have to be that way.

把關鍵字挑出來看,也就是說,GWT主要是用來進行JavaJava Script之間的轉換,我們只要用Java的語法去進行撰寫程式的動作,GWT Compiler會將我們的Java程式碼轉換成Java Script,這樣就不用去和Java Script進行奮鬥了。這對於完全不熟悉Java Script又想要開發AJAX應用程式的我來說,真是一大福音XD。

GWT的應用程式有兩種模式:Hosted ModeWeb Mode.
  • Hosted Mode:簡單來說,就是指本機端。我們可以在這裡用Java語言去撰寫應用程式,然後透過JVM去Compile。
  • Web Mode:在這個模式下,我們的應用程式被GWT Compiler轉換成JS和HTML。
要開始動手撰寫前,必須要先去下載GWT。下載回來之後,將檔案解壓縮會得到GWT的作業環境和Sample Code。根據GWT Tutorial的說法,GWT所提供的Sample都放在samples的資料夾下面。

下一篇我們來介紹一下要如何開始我們的第一個Sample!

Share this post!

Bookmark and Share

0 意見: