您的位置:首页 > Web前端

Difference between GWT.create(SomeClass.class) and new SomeClass()

2012-02-29 18:07 435 查看
GWT.create
is used by the GWT compiler for deferred binding. Deferred binding is a feature of the GWT compiler that works by generating many versions of code at compile time, only one of which needs to be loaded by a particular client during
bootstrapping at runtime. if the implementation doesn't change for different locale/browsers, use new, if there will be multiple implementations use create.

Coding Basics - Deferred Binding

Deferred binding is a feature of the GWT compiler that works by generating many versions of code at compile time, only one of which needs to be loaded by a particular clientduring bootstrapping at runtime. Each version is generated on a per browser basis,
along with any other axis that your application defines or uses. For example, if you were tointernationalize your application using

GWT's Internationalization module, the GWT compiler would generatevarious versions of your application per browser environment, such as "Firefox in English", "Firefox in French", "Internet Explorer in English", etc... As a result, the deployedJavaScript
code is compact and quicker to download than hand coded JavaScript, containing only the code and resources it needs for a particular browser environment.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: