Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Domain-specific languages and program generation with meta-AspectJ

Published: 12 November 2008 Publication History

Abstract

Meta-AspectJ (MAJ) is a language for generating AspectJ programs using code templates. MAJ itself is an extension of Java, so users can interleave arbitrary Java code with AspectJ code templates. MAJ is a structured metaprogramming tool: a well-typed generator implies a syntactically correct generated program. MAJ promotes a methodology that combines aspect-oriented and generative programming. A valuable application is in implementing small domain-specific language extensions as generators using unobtrusive annotations for syntax extension and AspectJ as a back-end. The advantages of this approach are twofold. First, the generator integrates into an existing software application much as a regular API or library, instead of as a language extension. Second, a mature language implementation is easy to achieve with little effort since AspectJ takes care of the low-level issues of interfacing with the base Java language.
In addition to its practical value, MAJ offers valuable insights to metaprogramming tool designers. It is a mature metaprogramming tool for AspectJ (and, by extension, Java): a lot of emphasis has been placed on context-sensitive parsing and error reporting. As a result, MAJ minimizes the number of metaprogramming (quote/unquote) operators and uses type inference to reduce the need to remember type names for syntactic entities.

References

[1]
Bachrach, J. and Playford, K. 2001. The Java syntactic extender (JSE). In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). ACM Press, New York, NY, 31--42.
[2]
Baker, J. and Hsieh, W. C. 2002. Maya: multiple-dispatch syntax extension in Java. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). ACM Press, New York, NY, 270--281.
[3]
Batory, D., Lofaso, B., and Smaragdakis, Y. 1998. JTS: Tools for implementing domain-specific languages. In Proceedings of the IEEE International Conference on Software Reuse (ICSR) (Victoria, B.C., Canada). 143--153.
[4]
Batory, D., Sarvela, J. N., and Rauschmayer, A. 2003. Scaling step-wise refinement. In Proceedings of the IEEE International Conference on Software Engineering (ICSE). IEEE Computer Society Press, Los Alamitos, CA, 187--197.
[5]
Bracha, G. and Cook, W. 1990. Mixin-based inheritance. In Proceedings of the European Conference on Object-Oriented Programming and Object-Oriented Programming Systems, Languages, and Applications (OOPSLA/ECOOP). ACM Press, New York, NY, 303--311.
[6]
Bravenboer, M., Vermaas, R., Vinju, J., and Visser, E. 2005. Generalized type-based disambiguation of meta programs with concrete object syntax. In Generative Programming and Component Engineering (GPCE) Conference, R. Glück and M. Lowry, Eds. Lecture Notes in Computer Science, vol. 3676. Springer, Berlin, Germany, 157--172.
[7]
Brichau, J., Mens, K., and Volder, K. D. 2002. Building composable aspect-specific languages. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2487. Springer, Berlin, Germany.
[8]
Bryant, A., Catton, A., De Volder, K., and Murphy, G. C. 2002. Explicit programming. In Proceedings of the Conference on Aspect-Oriented Software Development (AOSD). ACM Press, New York, NY, 10--18.
[9]
Calcagno, C., Taha, W., Huang, L., and Leroy, X. 2003. Implementing multistage languages using ASTs, gensym, and reflection. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2830. Springer, Berlin, Germany, 57--76.
[10]
Chiba, S. 1995. A metaobject protocol for C++. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). SIGPLAN Not. 30, 10, 285--299.
[11]
Chiba, S. and Nishizawa, M. 2003. An easy-to-use toolkit for efficient Java bytecode translators. In Generative Programming and Component Engineering (GPCE) Conference. Springer-Verlag, New York, NY, 364--376.
[12]
Clinger, W. 1991. Macros that work. In Proceedings of the Conference on Principles of Programming Languages (POPL). ACM Press, New York, NY, 155--162.
[13]
Cordy, J. R., Halpern-Hamu, C. D., and Promislow, E. 1991. TXL: A rapid prototyping system for programming language dialects. Comput. Lang. 16, 1, 97--107.
[14]
Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., and Black, A. P. 2006. Traits: A mechanism for fine-grained reuse. ACM Trans. Program. Lang. Syst. 28, 2, 331--388.
[15]
Gosling, J., Joy, B., Steele, G., and Bracha, G. 2005. The Java Language Specification, 3rd ed. Addison-Wesley, Boston, MA.
[16]
Guy L. Steele, J. 1990. Common LISP: The language, 2nd ed. Digital Press, Newton, MA.
[17]
Huang, S. S. and Smaragdakis, Y. 2006. Easy language extension with Meta-AspectJ. In Proceedings of the International Conference on Software Engineering, Emerging Results. 865--868.
[18]
Huang, S. S., Zook, D., and Smaragdakis, Y. 2005. Statically safe program generation with SafeGen. In Proceedings of the Generative Programming and Component Engineering Conference. 309--326.
[19]
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., and Griswold, W. 2001. Getting started with AspectJ. Commun. ACM 44, 10, 59--65.
[20]
Kohlbecker, E., Friedman, D. P., Felleisen, M., and Duba, B. 1986. Hygienic macro expansion. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming. ACM Press, New York, NY, 151--161.
[21]
Lohmann, D., Blaschke, G., and Spinczyk, O. 2004. Generic advice: On the combination of AOP with generative programming in AspectC++. In Generative Programming and Component Engineering (GPCE) Conference, G. Karsai and E. Visser, Eds. Lecture Notes in Computer Science, vol. 3286. Springer Verlag, Berlin, Germany, 55--74.
[22]
Mohnen, M. 2002. Interfaces with default implementations in Java. In Principles and Practice of Programming. National University of Ireland, Maynooth, County Kildare, Ireland, Ireland, 35--40.
[23]
Parr, T. J. and Quong, R. W. 1995. ANTLR: A predicated LL(k) parser generator. Softw.-Pract. Exp. 25, 7 (July), 789--810.
[24]
Rajan, H. and Sullivan, K. 2003. Eos: Instance-level aspects for integrated system design. SIGSOFT Softw. Eng. Notes 28, 5, 297--306.
[25]
Sheard, T. and Jones, S. P. 2002. Template metaprogramming for Haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell. ACM Press, New York, NY, 1--16.
[26]
Shonle, M., Lieberherr, K., and Shah, A. 2003. Xaspects: An extensible system for domain specific aspect languages. In Proceedings of OOPSLA'2003, Domain-Driven Development Track.
[27]
Smaragdakis, Y. 2004. A personal outlook on generator research. In Domain-Specific Program Generation, C. Lengauer, D. Batory, C. Consel, and M. Odersky, Eds. Lecture Notes in Computer Science, vol. 3016, Springer-Verlag, Berlin, Germany.
[28]
Smaragdakis, Y. and Batory, D. 1999. Scoping constructs for program generators. In Proceedings of the Generative and Component-Based Software Engineering Symposium (GCSE). Earlier version in Tech. rep. UTCS-TR-96-37, University of Texas at Austin, Austin, TX.
[29]
Soares, S., Laureano, E., and Borba, P. 2002. Implementing distribution and persistence aspects with AspectJ. In Proceedings of the Conferences on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). ACM Press, New York, NY, 174--190.
[30]
Taha, W. and Sheard, T. 1997. Multi-stage programming with explicit annotations. In Proceedings of the Conference on Partial Evaluation and Semantics-Based Program Manipulation (Amsterdam, The Netherlands, June). ACM Press, New York, NY, 203--217.
[31]
Tilevich, E., Urbanski, S., Smaragdakis, Y., and Fleury, M. 2003. Aspectizing server-side distribution. In Proceedings of the Conference on Automated Software Engineering Conference. IEEE Computer Society Press, Los Alamitos, CA.
[32]
Visser, E. 2002. Metaprogramming with concrete object syntax. In Generative Programming and Component Engineering (GPCE) Conference. Lecture Notes in Computer Science, vol. 2487. Springer, Berlin, Germany, 299--315.
[33]
Volder, K. D. 1998. Type-oriented logic meta programming. Ph.D. dissertation. Vrije Universiteit Brussel, Brussels, Belgium.
[34]
Weise, D. and Crew, R. F. 1993. Programmable syntax macros. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI). 156--165.
[35]
Zook, D., Huang, S. S., and Smaragdakis, Y. 2004. Generating AspectJ programs with meta-AspectJ. In Generative Programming and Component Engineering (GPCE) Conference. Springer-Verlag, Berlin, Germany, 1--18.

Cited By

View all
  • (2021)JavaDL: automatically incrementalizing Java bug pattern detectionProceedings of the ACM on Programming Languages10.1145/34855425:OOPSLA(1-31)Online publication date: 15-Oct-2021
  • (2019)An attribute language definition for adaptable parsing expression grammarsProceedings of the 34th ACM/SIGAPP Symposium on Applied Computing10.1145/3297280.3299738(1518-1525)Online publication date: 8-Apr-2019
  • (2018)Open meta-modelling frameworks via meta-object protocolsJournal of Systems and Software10.1016/j.jss.2018.07.023145(1-24)Online publication date: Nov-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 18, Issue 2
November 2008
130 pages
ISSN:1049-331X
EISSN:1557-7392
DOI:10.1145/1416563
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 November 2008
Accepted: 01 October 2007
Revised: 01 April 2007
Received: 01 December 2005
Published in TOSEM Volume 18, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Metaprogramming
  2. domain-specific languages
  3. language extensions
  4. program synthesis
  5. program transformation
  6. program verification

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2021)JavaDL: automatically incrementalizing Java bug pattern detectionProceedings of the ACM on Programming Languages10.1145/34855425:OOPSLA(1-31)Online publication date: 15-Oct-2021
  • (2019)An attribute language definition for adaptable parsing expression grammarsProceedings of the 34th ACM/SIGAPP Symposium on Applied Computing10.1145/3297280.3299738(1518-1525)Online publication date: 8-Apr-2019
  • (2018)Open meta-modelling frameworks via meta-object protocolsJournal of Systems and Software10.1016/j.jss.2018.07.023145(1-24)Online publication date: Nov-2018
  • (2016)Intent-Based Extensible Real-Time PHP Supervision FrameworkIEEE Transactions on Information Forensics and Security10.1109/TIFS.2016.256906311:10(2215-2226)Online publication date: Oct-2016
  • (2016)Web application protection techniquesJournal of Network and Computer Applications10.1016/j.jnca.2015.11.01760:C(95-112)Online publication date: 1-Jan-2016
  • (2014)Reusable software documentation with phrase annotationsOpen Computer Science10.2478/s13537-014-0208-34:4Online publication date: 1-Jan-2014
  • (2012)Synthesizing iterators from abstraction functionsACM SIGPLAN Notices10.1145/2480361.237140748:3(31-40)Online publication date: 26-Sep-2012
  • (2012)Synthesizing iterators from abstraction functionsProceedings of the 11th International Conference on Generative Programming and Component Engineering10.1145/2371401.2371407(31-40)Online publication date: 26-Sep-2012
  • (2011)Backstage JavaACM SIGPLAN Notices10.1145/2076021.204813746:10(939-958)Online publication date: 22-Oct-2011
  • (2011)Backstage JavaProceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications10.1145/2048066.2048137(939-958)Online publication date: 22-Oct-2011
  • Show More Cited By

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media