What is the current status of GWT
Overview GWT - Google Web Toolkit (PDF)
Orientation in Objects GmbH
Orientation in Objects GmbH
Google Web Toolkit
Web 2.0 software development
Web development today puts both decision-makers and developers in a difficult position. Due to a technologically hardly definable "Everything is possible with Web 2.0" expectation of the client, very high goals are set, on the other hand one would like the web of tomorrow (see box of the same name) today in the worst case based on one dominated by Microsoft Internet Explorer, Version 6 Operate yesterday's landscape. Sustainable decisions should then be made within this framework. And it is not uncommon for the right choice of a web framework to mutate into an uncontrolled corporate policy requirement for a long-term client strategy.
The strategy of the future often bears the title "RIA". Under the umbrella term "Rich Internet Application" (RIA), various approaches were presented on how to transform the original HTML terminal (browser) into an application platform. The aim is to combine the advantages of both client models (web and rich client) in one solution:
Uncomplicated software delivery:
Web applications do not need to be installed and updated, the application is always up-to-date. Changes and bug fixes can be imported and rolled out quickly compared to rich clients.
Low latency in operation:
In principle, rich clients process the user interaction locally (apart from incorrect implementations ...) and can relocate the server communication to the background.
Appealing user interface:
Rich clients often offer a greater variety of GUI components and thus greater flexibility in the design of (complex) user interfaces.
An RIA strategy is not without consequences. In this approach, the seasoned web application developer is confronted with a paradigm shift: Known and tried and tested architecture patterns, idioms and tools from classic web application development lose their validity, their meaning and / or their usefulness. While design patterns from rich client development are experiencing a renaissance here, development tools are faced with completely new requirements. Most of the libraries that have been used up to now can no longer be used, and solutions that have been developed no longer work in the new architecture.
What remains is the daring look into the future: Two large companies have placed themselves behind HTML5 - namely Google and Apple. With the exception of Internet Explorer, all modern browsers largely understand the unfinished HTML5 specification. Microsoft has announced HTML5 support in principle. This means that it is already clear: tragically, HTML5 will not play a role in the medium term - we will have to wait for Internet Explorer here. In recent years, companies have not shown themselves to be particularly willing to migrate. If this behavior does not change, then HTML5 will not play a role in the long term.
The Google Web Toolkit 2.0
The Google Web Toolkit (GWT, often pronounced "Gwit") is probably one of the most misunderstood technologies in the Java environment:
GWT is not the transfer / imitation of the Swing component model in the browser
GWT does not use any services from Google
GWT is now also used by Google [Schu09]: Google AdWords and Wave are developed with GWT
In development, GWT distinguishes between two modes:
Usually a GWT application (the products of the compilation process) is delivered as a WAR archive. The need for a Java EE web container is only given if the application uses the GWT-RPC mechanism. This is based on the servlet specification and requires a corresponding runtime environment.
Thanks to Ajax and DHTML, there is a change in the architecture of web applications. The browser is suddenly no longer used as a stupid HTML terminal, but as an application platform.
At this point we speak of the “single page” principle: A web application is loaded into the browser once, and there is no more page hopping. The latency generated by the request-render-response cycle is completely eliminated in this approach. For this, the user has to accept a larger initial download of the application (the first HTML page), which can then remain in the browser's cache.
In contrast to the classic approach, not every user interaction leads to a reload of the page. All user interactions are processed in the browser. Communication only takes place when data is required by the server. Only the required data is then requested and not the entire page again, because the data is then processed and displayed by the web application.
In an Ajax-ified architecture, server communication is reduced to a minimum. This not only saves server-side resources, but also reduces the latency in the application.
Since, according to the HTTP specification, a browser can only establish two connections to a server, GWT offers mechanisms to reduce the number of resources to be loaded. In GWT one speaks of so-called "ClientBundles", in which, for example, images are combined as a mosaic and CSS resources. Images are then displayed correctly again in the browser, for example via CSS clipping.
The compilation process does not become a weakness but a strength of GWT. This enables a separation between development or project and deployment layout. For maintenance reasons, resources are pragmatically managed individually in several fragments during development. The compilation process then repackages the resources so that HTTP connection bottlenecks and caching aspects can be taken into account.
The Google team provides a plug-in for development in the Eclipse IDE. For other development environments there are various solutions from third-party providers or from the open source community. In the meantime, a very large community of developers is gathering around GWT, which is evident in the number of books, projects and blogs on the topic of GWT.
That is why GWT does not stand for "eye candy", but much more for software engineering in web application development. Discussions, unofficial announcements in the official GWT mailing list and the current commits in the SVN trunk of the project strongly indicate that the problem of data storage components and data binding is currently being tackled for the next release. On the subject of "eye candy", the message is clear and precise: GWT applications can and should be adapted via CSS. Toolkits with extremely sophisticated GUI components all have one thing in common: The components are difficult to adapt because the CSS provided is very extensive (and confusing). Sometimes less is more ...
GWT and software engineering
As with any software development, expansion and maintenance costs play an essential role in the life cycle of a web application. We are looking for methods and procedures that lead to better software quality in advance, and architecture patterns that promote sustainable maintenance of the web applications.
Architecture "Best Practices"
The "Best Practices" presented here for the architecture of GWT applications come from a lecture by Ray Ryan at Google I / O 2009 [Ryan09, pgt09]. These architectural patterns were obtained from the new development of the AdWords application from Google and presented in the lecture:
Communication of individual components in the application via a central event bus.
Client-server communication via action result object pairs.
Structure and behavior of the UI components. In this approach, there is no direct access between model and view, the entire behavior of the user interface is encapsulated in the presenter and can be unit-tested.
A "Place" abstraction and the use of GWT's History API are used to regulate forward and backward navigation as well as jumping to the application via a bookmark.
For reasons of space, only EventBus and Command Patterns are presented in more detail in this article.
A well-known phenomenon in software development for developers and architects is the proliferation of references between objects, which makes changes difficult to implement.
An EventBus is introduced so that individual components (the definition of the granularity of a component is ultimately left to the developer and / or software architect) are not linked to one another via references. Since GWT allows the event model to be expanded, the existing infrastructure can be used at this point. Typing is guaranteed by introducing own event classes.
Illustration 1: Fig. 1: Master-detail view using the EventBus
A simple master-detail view is presented as an example. Instead of wiring both components (MasterView and DetailView) to one another via a reference, the perceived detour via the EventBus can also be selected (see Fig. 1). The procedure in detail:
An event class and the corresponding event handler interface are defined
The detailed view registers with the EventBus for a specific event class
The MasterView fires events via the central EventBus when data records have been selected
The DetailView is notified of the data record selection by the EventBus and displays the data
In principle, it is the well-known observer pattern. In the case of an extension (another component, for example a bread-crumb navigation component introduced afterwards), you can also register on the EventBus for the same event and update the navigation display accordingly when a selection event occurs.
Not only is it easy to expand, it will also be possible to remove the bread-crumb navigation that has been introduced without any side effects: it is sufficient to remove the component from the system. As a result, the component no longer logs on to the EventBus and is no longer notified.
The command pattern addresses, among other things, the problem of uncontrolled growth in service interfaces. In client communication in client-server architectures via RPC interfaces, it is not uncommon to find a multiplication of data transfer objects that are technically assigned to one and the same domain object. This multiplication arises from the technical approach to solve the problem of partial data transmission for different masks. In the following interface, this is demonstrated using the "customer" domain object as an example:
This interface is then used by all components in the software that want to display customer data in some form. The restriction of the data to be transmitted can be both technically sensible and technically necessary. The definition of several transfer classes ensures type safety in the different use cases. Such interfaces quickly lead to software that is difficult to maintain, as they cause an explosion in the class model on the one hand and create links across the various components on the other.
The approach proposed by Ryan with the command pattern replaces the interface-oriented RPC approach with an event-oriented approach: The communication to the server is modeled via action / result and handler classes (see Fig. 2) - the interface as such is omitted without type safety must be abandoned. The granularity of such action / result pairs can vary in the application. Coarse-grained actions in the sense of "Give everything the mask needs for the initial display" up to very fine-grained actions such as the individual validation of an input are conceivable.
Similar to the EventBus, the effects in the maintenance of the software are remarkable. The communication system is expanded or shrunk by simply adding the triple (action / result / handler) or by deleting a triple. The result classes are linked to the action classes and are only used in their context so that there is no explosion or wild growth in the object model. Even the problem of operating several versions of a service is taken into account by optimizing the way of the interface.
Figure 2: Fig. 2: Structure of a dispatcher infrastructure
The heart of the command pattern is the dispatcher infrastructure. There is already one or the other ready-made approach in the open source community. Thanks to the central nature of the dispatcher service, error handling, caching, retry algorithms, security information, etc. can be implemented centrally at this point.
Thanks to GWT, software engineering can finally find its way into web application development. Even if the GWT components do not win a beauty contest, it is the inner values that make GWT so attractive. GWT left the perceived "early adopters" status with version 2.0 at the latest and is now "production ready".
However, there is still a lack of experience in developing complex GWT applications. The deficiency was addressed thanks to Ray Ryan's architectural "best practices". The clear requirement is: decoupling. The open source community has already reacted and, in line with these experience reports, has launched a number of projects so that the introduction and practical implementation of these design patterns are made easier.
- Can someone write an Amazon product review
- Why can't hydrogen fire a rocket?
- How was your first day at IIM
- What a nutritious meal we have to eat every day
- What are Arnab Goswami's qualifications
- Would you date someone who is not religious
- What are the most stimulating fruits
- What is chromatic solfege
- What are some Japanese loanwords in Chinese
- How is MSIT 2nd Shift CSE
- What is your opinion on the forced consent
- What is a Fair FICO Score Range
- Is numerology real or just a scam
- Should I rest with DVT
- How do you make yourself mentally tired
- Why do crocodiles have sharp teeth
- How to give an injection of clindamycin
- Is online journalism good or bad
- What is the average annual vehicle mileage
- What are the best and worst functions of the body
- How does language 2
- Broccoli is a tuber
- What was Napoleon Bonaparte's work ethic like
- What are the benefits of face recognition