![](bg6.png)
To deal with these limitations, we are developing
a Web based application able of displaying the
algorithms directly on a web browser.
The web application is structured in two main
sections: the server and the client. We are making
the effort to use standard HTML, to allow using
regular web browsers as the client.
The server side concentrates the application
logic, responsible for storing the algorithms, execut-
ing them on demand on the Octave engine,
retrieving the execution resulting XML file and
producing the visualization, which will be sent to the
client.
In the desktop version, a single instance of the
Octave engine is sufficient to respond to the user
operation. However, in the Web based version, each
user has, potentially, allocated a different instance.
This can pose scalability and stability issues.
To prevent, as much as possible, these problems,
we are considering a server side cache mechanism,
to allow responding to user operations without
requiring on-the-fly interpretation of algorithms.
To leverage the code already developed for the
desktop operation, we are building the Web
application in Java Servlets, for the “hardcore” logic,
and JSF (Java Server Faces) and HTML for the
complementary website structure, such as forms and
documentation pages.
Figure 6: Snapshot of the web-based GraSMa.
5 CONCLUSIONS
This paper described GRASMA implementation.
The approach followed by this graphical simulation
tool was semi-automatic because it implied the
manual insertion of code inspector functions.
Here a big improvement is presented: the
numerical algorithm is automatically instrumented
and the algorithm visualization is generated with any
effort from the user.
The process is based in language processing
techniques and it allows simultaneously the
generation of XML code for further application
domains.
REFERENCES
Balsa, C., Alves, L., Pereira, M. J., Rodrigues, P.J. 2010.
Graphical Simulator of Mathematical Algorithm
(GraSMA). In Teaching and Learning 2010, Advances
in Teaching and Learning Research. IASK.
Berón M., Henriques P. R., Pereira M. J. V., Uzal R.,
2007. Static and Dynamic Strategies to Understand C
Programs by Code Annotation, In OpenCert'07, 1st
Int. Workshop on Fundations and Techniques for
Open Source Software Certification.
Cruz D., Béron M., Henriques P. R, Pereira M. J. V.,2009.
In Code Inspection Approaches for Program
Visualization, Editor Linus Michaeli, Faculty of
Electrical Engineering and Informatics, Technical
University of Kosice.
Ramalho J. C, Henriques P. R, 2002. XML & XSL: da
teoria à prática. FCA Editor. Lisbon, 1st Ed.
Cadenhead R. and Lemay L., 2007. Teach Yourself Java 6
in 21 Days. Sams, 5th Edition.
Shreiner D., 2009. OpenGL Programming Guide: The
Official Guide to Learning OpenGL, Versions 3.0 and
3.1. Addison-Wesley Professional, 7th Edition.
Aho A. V., Sethi R., and Ullman J. D., 1986. Compilers
Principles, Techniques and Tools. Addison-Wesley.
Levine J. R., Mason T., and Brown D., 1992. Lex & Yacc.
Ed. Dale Dougherty. O’Reilly & Associates Inc.
Parr T., 1999. Practical computer language recognition
and translation – a guide for building source-to-
source translators with antlr and java. http://
www.antlr.org/ book/index.html.
Henriques P., Varanda M. J., Mernik M., Lenic M., Gray
J., and Wu H., 2005. Automatic generation of
language-based tools using lisa system. IEE Software
Journal, 152(2):54–70, ISSN: 1462-5970.
GRAPHICALSIMULATIONOFNUMERICALALGORITHMS-AnAproachbasedonCodeInstrumentationandJava
Technologies
169