TAE-JS: automated enhancement of JavaScript programs by leveraging the Java annotations infrastructure

Recent state-of-the-art approaches enhance JavaScript programs with concerns (e.g., persistence, security, transactions, etc.) by modifying the source code by hand to use special libraries. As a result, adding concerns to a JavaScript program creates divergent codebases that must be maintained separately. At the core of the problem is that JavaScript lacks metadata to express concerns declaratively. In this paper, we present a declarative approach to enhancing JavaScript programs that applies the Java annotations infrastructure to JavaScript, without extending the JavaScript language. An IDE combines JavaScript and Java during the development, but processes the languages separately. Programmers declare how concerns should be added to a JavaScript program using Java annotations. Based on the annotations, a code generator synthesizes aspect code that adds the specified concerns. Although these enhancements are implemented as third-party libraries, our approach can transparently insert them into JavaScript programs given a declarative specification.

[1]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[2]  Mitsuru Matsui,et al.  On the Power of Bitslice Implementation on Intel Core2 Processor , 2007, CHES.

[3]  Dan Boneh,et al.  Symmetric Cryptography in Javascript , 2009, 2009 Annual Computer Security Applications Conference.

[4]  Craig Walls,et al.  XDoclet in Action (In Action series) , 2003 .

[5]  Daniel G. Bobrow,et al.  Common lisp object system specification , 1988, SIGP.

[6]  Éric Tanter,et al.  AspectScript: expressive aspects for the web , 2010, AOSD.

[7]  姜志军,et al.  对Java 2 Enterprise Edition主要设计模式的探讨 , 2006 .

[8]  Helen J. Wang,et al.  BrowserShield: vulnerability-driven filtering of dynamic HTML , 2006, OSDI '06.

[9]  Dan Grossman,et al.  Supporting dynamic, third-party code customizations in JavaScript using aspects , 2010, OOPSLA.

[10]  Shriram Krishnamurthi,et al.  Semantics and scoping of aspects in higher-order languages , 2006, Sci. Comput. Program..

[11]  Chester Rebeiro,et al.  Bitslice Implementation of AES , 2006, CANS.

[12]  Akihiko Tozawa,et al.  XML Validation for Context-Free Grammars , 2006, APLAS.

[13]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[14]  Benjamin Livshits,et al.  AjaxScope: a platform for remotely monitoring the client-side behavior of web 2.0 applications , 2007, TWEB.

[15]  Peter Schwabe,et al.  Faster and Timing-Attack Resistant AES-GCM , 2009, CHES.

[16]  Ajay Chander,et al.  JavaScript instrumentation for browser security , 2007, POPL '07.

[17]  Michael L. Van de Vanter,et al.  The Pan language-based editing system , 1992, TSEM.

[18]  Alan Kaplan,et al.  The Exu approach to safe, transparent and lightweight interoperability , 2001, 25th Annual International Computer Software and Applications Conference. COMPSAC 2001.

[19]  Vinod Ganapathy,et al.  Enhancing JavaScript with Transactions , 2012, ECOOP.

[20]  Eli Tilevich,et al.  Reusing non-functional concerns across languages , 2012, AOSD.

[21]  Eric Wohlstadter,et al.  Automated object persistence for JavaScript , 2010, WWW '10.

[22]  Terence John Parr,et al.  Enforcing strict model-view separation in template engines , 2004, WWW '04.

[23]  Hironori Washizaki,et al.  AOJS: aspect-oriented javascript programming framework for web development , 2009, ACP4IS '09.

[24]  Eli Tilevich,et al.  Metadata invariants: Checking and inferring metadata coding conventions , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[25]  David M. Beazley,et al.  SWIG: An Easy to Use Tool for Integrating Scripting Languages with C and C++ , 1996, Tcl/Tk Workshop.

[26]  Christian Bauer,et al.  Hibernate in action , 2005 .

[27]  Jörg Kienzle,et al.  AOP: Does It Make Sense? The Case of Concurrency and Failures , 2002, ECOOP.

[28]  Mira Mezini,et al.  Declaring and Enforcing Dependencies Between .NET Custom Attributes , 2004, GPCE.

[29]  John W. Stamey,et al.  The aspect-oriented web , 2005, SIGDOC '05.