Modelling and Generating AJAX Applications
Modelling and Generating AJAX Applications
32
ICWE 2008 Workshops, 7th Int. Workshop on Web-Oriented Software Technologies – IWWOST 2008
applications. The interactivity aspect is manifested by the Conallen [4] proposes a UML profile for modelling web
fact that refreshing the whole page is not needed for each applications. This approach is widely referenced as a web
client server interaction. The user interface can consist of modelling scheme. Koch and Kraus [6] propose UWE,
a single web page composed of UI components which can a UML profile and notations for modelling the navigation
be acted upon and updated independently of other compo- and conceptual aspects of a web application. Both ap-
nents. This technique has made it possible to port similar proaches are aimed at classic multi-page web applications.
versions of many desktop applications to the web, exam- RUX-model [2, 14] is an MDA approach towards Rich
ples of which include office tools such as word processors Internet Applications (RIA) based on WebML. In this ap-
(Google Docs and Spreadsheets1 ) and e-mail management proach WebML is extended with notations which indicate
software (Yahoo! Mail2 ). whether certain data is stored or presented on the client or
A JAX applications can be seen as a hybrid of desktop the server. In the latter stages, the RIA is modelled using the
(e.g., Swing) and web applications, inheriting characteris- RUX-model notation (not UML) and subsequently Flash-
tics from both worlds [10]. Therefore modelling A JAX re- based RIA instances (e.g., OpenLaszlo) are generated. Ac-
quires a different approach than what the current web mod- cording to the authors, also the same models can be used to
elling tools are providing. Whereas in classic web appli- generate A JAX applications. It appears that only the user in-
cations the notion of web pages and links between them terface part is generated by RUX-model since issues such as
is central, in A JAX, user interface components and the the back-end or the toolkits employed in the generation of
event-based interaction between them form the founding el- the whole web application are not mentioned. RUX-model
ements. is currently unavailable for experimenting.
The advantages of MDA [11] encouraged us to explore Another attempt at an MDA approach for RIAs is found
the possibilities of creating a tool which can transform in [7]. The approach is based on XML User Interface de-
a platform independent model (PIM) to a platform specific scription languages and XSLT is used as the transformation
model (PSM) and subsequently to a single-page A JAX web language between the different levels of abstraction. Again,
application. While tools exist for the generation of applica- this approach is oriented towards the User Interface and
tions for specific platforms such as J2EE and .NET, we have lacks flexibility in an MDA approach for the whole web
not encountered any such tool for A JAX. With such a trans- application. It also lacks a visual notation and cannot be
formation, models used to generate legacy web applications modelled using existing CASE-tools. This is also true in
can be used to generate single-page web applications and the case of other XML-based UI languages such as XUL3 ,
vice versa. Also the same models can be used to generate XAML4 and UIML [1] which do not offer the simplicity of
code for different A JAX frameworks. a visual model.
We are interested in an MDA approach for the main Visser [15] proposes a domain-specific language called
structure of the A JAX application, as well as the possibil- WebDSL for developing dynamic web applications with
ity of integrating with back-end components such as Spring a rich data model. WebDSL applications are translated to
and Hibernate. It should also be possible to model which classical Java web applications, building on the JSF, Hiber-
events affect which components (listeners). For the sake of nate, and Seam frameworks.
simplicity, we propose to leave certain layout information openArchitectureWare5 (oAW) is currently one of the
such as the precise position of components and styling, out leading open-source MDA generator frameworks. It is very
of the abstract models. extensible and supports model-to-model and model-to-text
transformations. However, oAW does not come with com-
3 Related Work plete integrable transformations for different web platforms,
nor does it define platform-independent elements which
There have already been several developments in the area can be used across web applications (and possibly other
of MDA for the web. In this section we explore some of the paradigms). The lack of the aforementioned possibilities
most relevant approaches. are certainly not necessities for a good MDA framework yet
The Web Modeling Language (WebML) [3] is a vi- we consider them very convenient when working with a set
sual notation for specifying the structure and navigation of varying technologies intended for web applications.
of legacy web applications. The notation greatly resem- One approach which has gained much attention in the
bles UML class and Entity-Relation diagrams. Presentation web-based MDA community is the A NDRO MDA MDA
in WebML is mainly focused on look and feel and lacks generator6 . We have based our approach on A NDRO MDA
the degree of notation needed for A JAX web user inter-
3 http://www.mozilla.org/projects/xul/
faces [2, 14]. 4 http://www.xaml.net/
1 http://documents.google.com/ 5 http://www.openarchitectureware.org
2 http://mail.yahoo.com 6 http://www.andromda.org
33
ICWE 2008 Workshops, 7th Int. Workshop on Web-Oriented Software Technologies – IWWOST 2008
34
ICWE 2008 Workshops, 7th Int. Workshop on Web-Oriented Software Technologies – IWWOST 2008
35
ICWE 2008 Workshops, 7th Int. Workshop on Web-Oriented Software Technologies – IWWOST 2008
5.2 Code Generation We apply the above concepts for modelling A JAX UIs to
the P ERSON M ANAGER example mentioned earlier. P ER -
SON M ANAGER has already been built using the A N -
Code generation for the metamodel described above is
DRO MDA JSF cartridge, which uses a legacy UI. A shift
carried out in the same manner as in the other cartridges of
to A JAX would mean each of the use cases should be ac-
A NDRO MDA. Apache Velocity8 template files gain access
cessed through a single-page mechanism. An example
to model elements through metafacades. They can subse-
quently iterate through the model abstract syntax tree and 9 http://component-showcase.icefaces.org/
10 Facelets is a view technology for JSF, and a powerful templating system based
8 http://velocity.apache.org/ on XML-style templates, https://facelets.dev.java.net
36
ICWE 2008 Workshops, 7th Int. Workshop on Web-Oriented Software Technologies – IWWOST 2008
model for P ERSON M ANAGER based on the A JAX meta- 8th International Conference on World Wide Web, pages
model is shown in Figure 4. In this model, the navigation 1695–1708, 1999.
to the use cases is managed through a tab bar and the only [2] J. Carlos Preciado, M. Linaje, S. Comai, and F. Sanchez-
event described for the remove person use case is captured Figueroa. Designing Rich Internet Applications with Web
using the AjaxEvent stereotype. This event only causes the engineering methodologies. In Proceedings of the 9th IEEE
International Symposium on Web Site Evolution (WSE’07),
view to be changed but it could also have a list of listeners
pages 23–30. IEEE Computer Society, 2007.
(other components) be updated. [3] S. Ceri, P. Fraternali, and A. Bongio. Web modeling lan-
The development of the A JAX cartridge for A N - guage (WebML): a modeling language for designing web
DRO MDA is a work in progress and a working cartridge sites. Computer Networks, 33(1-6):137–157, 2000.
will be available for download as soon as enough code can [4] J. Conallen. Building Web Applications with UML (2nd Edi-
be generated for a simple A JAX application. tion). Addison-Wesley, 2003.
[5] J. Garrett. Ajax: A new approach to web applications.
Adaptive path, 2005. http://www.adaptivepath.com/
6 Discussion publications/essays/archives/000385.php.
[6] N. Koch and A. Kraus. The expressive power of UML-based
Issues regarding which data resides on the server or the web engineering. In IWWOST ’02: 2nd International Work-
client are currently not captured by our model, since we be- shop on Web-oriented Software Technology, pages 105–119.
lieve these are framework-specific (for example GWT and CYTED, 2002.
[7] F. J. Martı̀nez-Ruiz, J. Munoz Arteaga, J. Vanderdonckt, and
Echo2 designs differ in this issue). The choice of A JAX
J. M. Gonzàlez-Calleros. A first draft of a model-driven
framework may somewhat affect the A JAX metamodel pro- method for designing graphical user interfaces of Rich In-
posed in this paper. This will be mainly in the area of the ternet Applications. In LA-Web ’06: Proceedings of the 4th
offered components and not the main structure of the web Latin American Web Congress, pages 32–38. IEEE Com-
application. puter Society, 2006.
Many web applications seen today are a blend of A JAX [8] A. Mesbah, E. Bozdag, and A. van Deursen. Crawling Ajax
and classical multi-page applications where small compo- by inferring user interface state changes. In Proceedings
nents in the page use A JAX to avoid refreshing the whole of the 8th International Conference on Web Engineering
page. Our aim has been to devise a metamodel for single- (ICWE’08). IEEE Computer Society, 2008.
[9] A. Mesbah and A. van Deursen. Migrating multi-page web
page user interfaces and the aforementioned applications do
applications to single-page Ajax interfaces. In Proceedings
not fit in this category. Nevertheless we believe that with
of the 11th European Conference on Software Maintenance
minor adjustments to the metamodel these hybrid applica- and Reengineering (CSMR’07), pages 181–190. IEEE Com-
tions can also be modelled, e.g., events which cause a redi- puter Society, 2007.
rect to a new instance of AjaxContainer. [10] A. Mesbah and A. van Deursen. A component- and push-
based architectural style for Ajax applications. Journal of
Systems and Software (JSS), 2008. To appear.
7 Concluding Remarks [11] J. Miller, J. Mukerji, et al. MDA Guide Version 1.0.1, 2003.
http://www.omg.org/docs/omg/03-06-01.pdf.
The main contributions of this paper can be summarised [12] OMG. MDA, 2008. http://www.omg.org/mda.
as follows: an overview of the current model-driven web ap- [13] D. C. Schmidt. Model-driven engineering. Computer,
proaches; a meta-model for modelling A JAX user interfaces 39(2):25–31, 2006.
in UML and the proposed approach for creating an A JAX- [14] M. L. Trigueros, J. C. Preciado, and F. Sánchez-Figueroa. A
based A NDRO MDA cartridge with ability to integrate with method for model based design of Rich Internet Application
interactive user interfaces. In ICWE ’07: Proceedings of the
back-end components such as Spring and Hibernate.
7th International Conference Web Engineering, pages 226–
Future work consists of completing and testing the im- 241. Springer, 2007.
plementation of the A JAX cartridge and conducting case [15] E. Visser. WebDSL: A case study in domain-specific lan-
studies to evaluate our proposed meta-model and the overall guage engineering. In Generative and Transformational
MDA approach for modelling and generating A JAX web ap- Techniques in Software Engineering (GTTSE 2007), Lecture
plications. The cartridge will be made available for down- Notes in Computer Science. Springer, 2008.
load soon.
References
37