ICCGI 2013 : The Eighth International Multi-Conference on Computing in the Global Information Technology An Eclipse Plug-in for Aspect-Oriented Bidirectional Engineering Oscar Pulido-Prieto, Ulises Juárez-Martínez Division of Postgraduate and Research Studies Instituto Tecnológico de Orizaba Orizaba, Veracruz, México Email: [email protected], [email protected] Abstract—This paper describes a plug-in for the IDE Eclipse, scope of this work is presented. In Section 6, a code which enables the generation of AspectJ and CaesarJ code generation example is provided. In Section 7, the conclusions from a UML class diagram, as well the capability to perform are discussed. Finally, in Section 8, future work is described. reverse engineering from these languages to obtain a system model in a UML class diagram representation. In addition, the II. RELATED WORK capability of generating an XML representation for In [3], a plugin for an Eclipse Integrated Development visualization and understanding of AspectJ and CaesarJ code is provided. This plug-in also provides a graphical interface for Environment was presented. This plug-in generates AspectJ and CaesarJ code from an XML Metadata Interchange system design through UML. (XMI) document generated with a modeling tool. This plug- Keywords-AspectJ; CaesarJ; UML; Software Engineering; in was developed using the Eclipse Modeling Framework Reverse Engineering. (EMF), a Model-View-Controller (MVC)-based architecture and a meta-model for AspectJ and another for CaesarJ. Both meta-models were defined through Java annotations, which I. INTRODUCTION belong to the core of EMF (Ecore) and transform Java Aspect-oriented programming (AOP) [1] involves the interfaces into EClasses. This transformation occurs through development of modular components, which simplifies their the XQuery query language to search for items that are reuse and maintenance. AOP solves encapsulation problems required in the XMI document. This plug-in is only focused in object-oriented programming (OOP) [1] and structured on code generation from UML class diagrams; the system programming [1]; such problems consist of an inability to modeling is carried out with an external tool and is exported encapsulate elements whose functionality covers more than a to the XML format, and the plug-in just generates code. single object when these elements are not related through In [4], a tool that allows the representation of CaesarJ inheritance, composition, or aggregation. source code in XML format, simplifying the design of code Nowadays, there are several commercial tools for code generators and code analyzers, was presented. This tool generation; these cover the object-oriented paradigm and the generates XML documents based on a Java file containing aspect-oriented paradigm, but only partially for the aspect- CaesarJ code. The generated XML document is validated oriented paradigm. This necessitates the use of extensions using an XML Schema (XSD). As an XML management that are difficult for novice developers to understand. The Application Programming Interface (API), Java API for inability to make equivalences between different aspect- XML Processing (JAXP) was also used because this API oriented languages is another problem; it decreases supports several processing standards, allows interoperability and delays paradigm consolidation. transformations of XML documents, and XML Schema In this paper, a plug-in for the Integrated Development support is a standard part of JAXP. An analysis of the Environment (IDE) Eclipse [2] is presented. This plug-in different approaches for creating XML documents was adds the capability of generating code in AspectJ and made, and one representing the elements as an abstract CaesarJ from a model generated with a Unified Modeling syntax tree was selected. As a result, a minimal tool for the Language (UML) extension through stereotypes, and generation of an XML document from CaesarJ source code generates a model from both languages, which comprises and for obtaining source code for an XML document was direct engineering. In addition, the plug-in generates an developed. eXtensible Markup Language (XML) representation of both In [5], BON-CASE, a Computer-Aided Software languages to improve the application design, which Engineering (CASE) tool for generating Java code, was comprises reverse engineering. The combination of both presented. This was accomplished from a modeling diagram direct and reverse engineering constitutes what is known as Business Object Notation (BON) language. This tool was bidirectional engineering. developed to solve the need for a system that allows the This paper is organized as follows: In Section 2, previous generation of source code efficiently from a system abstract studies related to this work are presented. In Section 3, the model, and also to generate robust and accurate plug-in architecture is described. In Section 4, the plug-in implementations. The authors highlighted the existing CASE capabilities are analyzed. In Section 5, a discussion of the tool features, which allow tests to be carried out and code to Copyright (c) IARIA, 2013. ISBN: 978-1-61208-283-7 195 ICCGI 2013 : The Eighth International Multi-Conference on Computing in the Global Information Technology be generated, but with limitations in terms of robustness and demonstrating the design using UML were highlighted. To analysis of the correctness of a model. BON-CASE is an solve this problem; the authors proposed the creation of a extensible CASE tool for the BON modeling language framework called Aspect-Oriented Crosscutting Framework. focused on contracts and frame specifications; it generates In [12], a method of aspect-oriented modeling, using the Java source code. BON-CASE generates low coupling model-driven process that focuses on business applications, components to integrate these components in other was described. The authors mentioned that there are no platforms. BON-CASE offers a formal specification backup, means of modeling crosscutting concerns in UML; this code generation extensible templates, and a partially generates system designs with scattered artifacts; against this validated meta-model. The authors mentioned that UML is a background, they proposed modeling crosscutting concerns modeling language that generates system-independent views. in UML diagrams representing aspects, advice, and crosscuts UML allows the use of formal techniques through Object as first-class models to produce an aspect-oriented model. Constraint Language (OCL). BON, on the other hand, is Table 1 shows a comparison of the contributions of each based on formal techniques that allow an inherent design by study described above. The target language and modeling contracts. BON-CASE generates code in the Java Modeling language are shown, as well as the restrictions in terms of Language (JML). both design and programming. Among these studies, only In [6], meta-programming was defined as the act of the BON-CASE tool provides mechanisms for both direct writing programs that generate other programs; this approach and reverse engineering, but is limited to the Java language is essential for automated software development. On this and the BON modeling language; the other works shown in basis, the authors developed Meta-AspectJ, a meta-language Table 1 are design specifications. In the last row, our work is that extends Java code to generate AspectJ code. Meta- shown in order to highlight the current contribution with AspectJ is based on generative programming and aspect- respect to previous studies. oriented programming to design a specific domain aspect- oriented code generator, which generates efficient code to III. PLUG-IN ARCHITECTURE solve AspectJ limitations in general purpose code generators. Eclipse is an IDE based on plug-ins that encourages the The authors mentioned the disadvantages of domain-specific use of the Model-View-Controller architectural pattern. APIs: compatibility regressive problems when libraries are In the Model layer, a meta-model through EMF is updated and bad interaction when these are independently defined, as well as an XSD template and an eXtensible modified. Meta-AspectJ solves these problems through the Stylesheet Language Transformations (XSLT) template for use of annotation that does not interfere with code execution transformations between aspect source code and its XML and syntax. representation. With EMF, a set of interfaces was generated In [7], an analysis of aspect-oriented framework to obtain a general meta-model and two specific meta- architecture was performed. The authors proposed that there models for AspectJ and CaesarJ, as is shown in Figure 1(1). is a problem that results from the inability to encapsulate In the Controller layer, the behavioral mechanism for the nonfunctional requirements as these are scattered throughout plug-in is defined. The controller has two parsers, which the system; they mentioned that the main problems of aspect- transform source code into an XML representation: one for oriented architecture are the language type used and source AspectJ and the other for CaesarJ. This is possible by using transformations. an Abstract Syntax Tree, which decomposes the source code In [8], Aspectra, a framework designed to carry out test into nodes and then generates the XML representation, as is entry in previously generated aspects to measure reliability, shown in Figure 1(2). On the other hand, an XSLT is used to was developed. The authors mentioned that the development
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-