You are kindly invited to try out a new GWT based service that I am
launching.
www.cellamea.eu
With this service, you can manage the inventory of your wine cellar on
line. The database with wines does not
contain much data yet, but I hope that this will change as the service
gets used more.
Some more technical information about the service in general and the
use of GWT in particular.
1. MVP
The client side follows the MVP pattern (though not using a general
eventbus).
Model : Value objects carry the attributes of the domain objects. The
value objects are defined
in XML schemas (with some restrictions, but supporting the majority of
data types defined in XML schemas, XML schema includes and extends).
The java implementation is generated using an XSLT transformation
(similar to JAXB).
The interface of the value objects have the following methods:
* getters
* setters : using basic types or using String.
* "adders" : for repeating members
* validate : XML schema facets can be used to define syntax validation
rules for the value objects (min lengths, max lengths, min occurs,
max occurs, min value, max value, total digits, fractional digits).
Java code is generated that verifies these rules and throws an
exception with a identification of which fields have which errors.
* toXML : marshalling into XML
This implementation can be used on client and server side.
Unmarshallers are also generated to instantiate a value object,
starting from the XML representation.
Unmarshallers for client and server are generated(GWT has its own XML
parser and DOM interface definition, hence the unmarshallers cannot be
identical)
The model is locale insensitive, i.e. it uses standard
representations for date, time, numbers,...
Presenter : the presenter is implemented in two parts
- ServiceController : responsibilities
*interact with server,
*retrieve value objects from the view and set value objects in the
view.
- InteractionController : responsibilities
* translate events from the view into method calls on the
ServiceController
* steer the "page flow" in the view, based on events received from
the ServiceController (e.g. show the correct view, display exceptions,
display or hide overlays to simulate a synchronous
interaction,...).
This split allows to reuse InteractionController for common
interaction patterns (for example search, list, detail page
sequences).
View : The view is also made up of several classes
- Application views : these are traditional windows, for example for
search criteria, entry screens, list screen with search results, etc.
The application views are responsible for the locale manipulations.
- "Glue classes" (sorry for this rather high level name, I could not
come up with something better) : starting point to put everything
together
* create presenter classes and application views and "glue"
everything together
* show correct application view on request of the
InteractionController
These glue classes lend themselves very well to code splitting as they
are the entry point to the instantiation of the Presenter classes
and the Application views.
2. Deployment
Static files and java script are deployed on an Apache 2 server. This
allows to do some URL rewriting, for example to add locale in the
query string.
Server side follows the SOA principles, (authentication service,
reference data service, static data service, cellar management
service, inquiry service,...).
Each service provides several commands (e.g. createCellar,
applyDelivery, ...) The services are deployed as servlets on Tomcat
5.5.
Database is MySQL. Development and testing is done on Windows,
production deployment on a virtual Linux server.
RPC uses the GWT RPC implementation but very restricted, i.e. all
service calls have a signature of the following type:
String serviceCommand(String requestXML) throws ServiceException
(where serviceCommand is of course the actual name of the command).
The strings are XML representations of request and reply objects.
These are defined and generated using the same mechanism as the value
objects from the model.
Marshalling into XML and unmarshalling from XML are straightforward
calls of the generated methods.
So I only use the scaffolding of the GWT servlet and the handling of
exceptions, not the GWT serialization of the paramaters.
The site is only accessible over SSL to assure the confidentiality of
the data. Cache-control header is set to public for the cacheable js
files
to incite the browsers to cache them (works on Chrome, IE8 and FF3)
3. Authentication
Support for OpenID in general withs specific flavours for using your
Google or Yahoo mail account. Also support for email address and
password. You can use
multiple authentication mechanisms for the same user.
4. Localisation
The service is available in English, Dutch and French. You can define
application level codes as XML schema enumerations and use these types
in your
ValueObjects. These definitions are translated into
Java enumerations and GWT ConstantsWithLookup interfaces/property
files, such that you can work with expressions such as WineColor.RED
or
wine_color().get(wine.getColor.getCode()) to get the locale specific
description.
I want to express my deep gratitude and high esteem to the GWT team
and all the people that have contributed to it.
Without GWT, I would never be able to build this!
Have fun!
Danny Goovaerts
www.cellamea.eu
www.oobikwe.eu
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.