On the Relationship of
Aspect-Oriented Programming and GenVoca

Richard Cardone

Department of Computer Sciences
University of Texas at Austin
Austin, Texas  78712

Tel: (512) 471-9711

Email: richcar@cs.utexas.edu

URL: http://www.cs.utexas.edu/users/richcar
 
 

 Abstract

Aspect-Oriented Programming (AOP) is a meta-programming model that promotes code reuse by localizing the implementation of design features that cut across multiple functional units.  GenVoca is a model of hierarchical software construction that enables customized applications to be assembled from interchangeable and reusable components.  Despite differences in starting point, focus, and style, these two software engineering approaches are remarkably similar at a fundamental level.  Basic concepts in AOP have an analog in GenVoca and vice versa.  Additionally, the effort needed to implement these systems appears to be comparable.  In this paper, I briefly explore the similarities and differences of these two approaches and the significance of the commonalties found.

Keywords: software reuse, software component, DSSA, aspect-oriented programming, programming-in-the-large, software architectures, layered architectures, domain-specific software architectures, product-line architectures.

Workshop Goals: Seeking a general, unifying theory of software component reuse.

Working Groups: Working groups that discuss software architectures, componentry or other technologies that promote code and/or design reuse and ease of maintenance.
 

1 Background

Proposals for large scale software reuse typically introduce some concept of a software component along with a design and implementation framework which allows component composition.  One of the greatest inhibitors to large scale reuse is the problem of code tangling or cross-cutting features.  Implementing new features that require changes to many components intermixes unrelated code at various sites and disseminates logically connected code throughout the code base.  Over time, the original design is obscured and the code becomes harder to understand and maintain.  Various approaches to software design have been proposed in which a logical feature is encapsulated as a single entity.  These approaches are current topics of research and each one conceptualizes its component framework using its own unique perspective and vocabulary.  It is important to understand commonalties that may exist between these approaches to gain insight into intrinsic principles at work.  This discussion relates two such approaches and explores the significance of the commonalties found.

2 Position

Aspect-Oriented Programming (AOP) and GenVoca, though seemingly dissimilar in approach and technology, are very similar in their basic concepts and the effort required for their implementation.

3 Approach

3.1 Fundamental Concepts

In an object-oriented environment, a large-scale refinement is an encapsulation of a set of changes to one or more classes to implement a particular design feature.  Data members and methods may be added or changed; new classes can be introduced.  Both GenVoca and AOP express such refinements in an object-oriented setting using their own concepts and techniques.  However, their basic concepts are largely equivalent.

AOP starts with user-written components that cleanly encapsulate some application function in code.  AOP components can be methods, classes, etc.  AOP then applies one or more aspects to these components to perform large-scale refinements.  Aspects implement design features that may modify or cross-cut multiple components.  All modifications take place at predefined join points.  Join points may be as generic as constructs in the host programming language or as specific as code markers unique to an application.

GenVoca, on the other hand, defines standardized interfaces called realms which may contain multiple classes and their methods.  GenVoca components are modules that export a realm interface and encapsulate the implementation of a single design feature.  GenVoca components may also import realm interfaces allowing components to be parameterized by other components.  Such compositions are specified in type equations.  Each component implements a large scale refinement; a composition of components represents a composition of such refinements.

Though AOP and GenVoca have different starting points, both begin with some encapsulated representation of system function (AOP component, GenVoca realm) and provide a mechanism to define and apply large-scale refinements (AOP aspects, GenVoca components) at specific sites (AOP join points, parameters in GenVoca components).

3.2 Implementation

In AOP, aspect languages are defined which operate on and transform components that conform to each language's specification.  In GenVoca, a type equation guides the transformation of multiple components to produce a monolithic implementation of a realm's interface.  The AOP weaver and the GenVoca generator perform these transformations respectively.  Both have been implemented as preprocessors to underlying programming language compilers.  Each transformer first represents existing or base code in some internal format (e.g., an abstract syntax tree, control flow graph, etc.), performs refinements as they have been specified in AOP aspects or GenVoca components, and then generates code in the host programming language.

There are certain issues that have been dealt with in GenVoca which have not yet been addressed in the AOP literature.  For example, not all compositions of GenVoca components are correct.  General algorithms for validating the component compositions have been developed [Bat97a].  Corresponding validation problems will surface when multiple AOP aspects are composed.  For optimization purposes, some GenVoca implementations allow interactaction between components at composition time [Bat93, Bat98].  Similar techniques may be required for  AOP aspects to generate efficient code in similar circumstances.  GenVoca type equations can be automatically rewritten using expert knowledge to express a more optimized application design [Bat98].  The same type of built-in guidance would also be valuable to AOP users composing large numbers of aspects at once.

3.3 Focus

The different starting points of the two approaches reveal their different emphases.  AOP can build an aspect language and weaver for any existing code base.  If the aspect language uses only the constructs of the underlying programming language as join points (such as aspects that wrap any method definition), then it can be applied to all programs written in the language.  If the aspect language uses application-specific patterns or markers as join points, then the language is restricted to that application.

GenVoca requires the definition of standardized realm interfaces as its starting point.  This is usually preceded by a domain analysis which reveals what standardized interfaces should be supported.  Each interface defined represents a subsystem abstraction whose implementations are specified by families of subsystems (type equations), called an application family.

Whereas GenVoca provides techniques to decompose existing applications into reusable and composable components, AOP supports the reuse of existing code by applying new features in a controlled and localized way.

3.4 Assessment

Both AOP and GenVoca allow code to be easily composed and customized by mixing and matching high level design features.  In AOP, one chooses which aspects to weave together; in GenVoca, one chooses components to include in a type equation.  Both can produce families of applications with a range of features.  In both approaches, composition can take place statically at compile time or dynamically at run-time.

These two approaches start with different assumptions and use ostensibly different techniques to support software refinement.  How can so many parallels be drawn between the two approaches?  The answer lies in the fact that both  perform software refinements at the same scale.  There may be a common conceptual framework underlying both approaches or, more generally, any approach to large-scale refinement.  Identifying such an abstraction would be important step in realizing the goal of reusable software componentry.  The study of the  AOP-GenVoca relationship provides one data point in this effort.

At this point, the fundamentals of large-scale software refinement can only be conjectured.  Exploring the relative expressive powers of AOP and GenVoca may help uncover underlying principles.  It's safe to say there's significant overlap in the transformations that can be easily and naturally expressed using either approach.  The exact extent of this overlap is an area for further study.

4 Related Work

In addition to the GenVoca [Bat*] and Aspect-Oriented Programming [Kic97, Lop97, Men97] papers,  ideas contributing to recent research in the area of reusable and composable software include subjectivity [Har93],  design patterns [Gam94, Tok95], frameworks [Boh98, Joh97, Mil97], software architectures [Sha95, Per92], and layered component systems [Ren96].

5 Acknowledgements

I thank Don Batory for his support and guidance on this work.

6 References

[Bat92]  D. Batory and S. O'Malley, ?The Design and Implementation of Hierarchical Software Systems with Reusable Components,? ACM TOSEM, October 1992.

[Bat93]  D. Batory, V. Singhal, M. Sirkin, and J. Thomas, ?Scalable Software Libraries,? ACM SIGSOFT, 1993.

[Bat97a]  D. Batory and B.J. Geraci, ?Validating Component Compositions and Subjectivity in GenVoca Generators,? IEEE Transactions on Software Engineering, February 1997, pp. 67-82.

[Bat97b]  D. Batory, B. Lofaso and Y. Smaragdakis, ?JTS, Tools for Implementing Domain Specific Languages,? to appear at the 5th International Conference on Software Reuse, (ICSR '98).

[Bat98] D. Batory, Gang Chen, Eric Robertson and Tao Wang, ?Web-Advertised Generators and Design Wizards,? 5th International Conference on Software Reuse, Victoria Canada, June, 1988.

[Boh98] K. Bohrer, ?Architecture of the San Francisco Frameworks,? IBM Systems Journal, Vol. 37, No. 2, 1998

[Gam94] E. Gamma, R. Helm, R. Johnson and J. Vlissides, ?Design Patterns: Elements of Reusable Object-Oriented Software,? Addison-Wesley, 1994.

[Har93]  W. Harrison and H. Ossher, ?Subject-Oriented Programming (A Critique of Pure Objects),? OOPSLA 1993, 411-428.

[Joh97] R. Johnson, ?Components, Frameworks, Patterns,? (extended abstract) ACM SSR '97

[Kic97]  G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. V. Lopes, J. Loingtier and J. Irwin, ?Aspect-Oriented Programming,? ECOOP 97, pp. 220-242.

[Lop97]  C.V. Lopes and G. Kiczales, ?D: A Language Framework for Distributed Programming,? TR SPL97-010, P9710047 Xerox Palo Alto Research Center, February 1997.

[Men97]  A. Mendhekar, G. Kiczales and J. Lamping, ?RG: A Case-Study for Aspect-Oriented Programming,? TR SPL97-009, P9710044 Xerox Palo Alto Research Center, February 1997.

[Mil97] H. Mili, H. Sahraoui and I. Benyahia, ?Representing and Querying Reusable Object Frameworks,? ACM SSR '97.

[Per92] D. Perry and A. Wolf, ?Foundations for the Study of Software Architecture,? ACM SIGSOFT Software Engineering Notes, 17(4):40-52, October 1992.

[Ren96] R. van Renesse, K. Birman and S. Maffeis, ?Horus: A Flexible Group Communication System,? Communications of the ACM 39,4:76-83 (April 1996)

[Sha95] M. Shaw, R. DeLine, D. Klein, T. Ross, D. Young and G. Zelesnik, ?Abstractions for Software Architecture and Tools to Support Them,? IEEE Transactions on Software Engineering, 1995.

[Tok95] L. Tokuda and Don Batory, ?Automated Software Evolution via Design Pattern Transformations,?
ISACC '95.

7 Biography

Richard Cardone (richcar@cs.utexas.edu) Department of Computer Sciences, University of Texas at Austin, http://www.cs.utexas.edu/users/richcar.

I'm currently a Ph.D. student at the University of Texas working with Professor Batory on topics of software component composition and reuse.  Interest in this area is the net result of twelve years of work as a professional programmer.  I earned a B.S in Mathematics from the State University of NY at Oneonta, Oneonta, NY, and an M.S. in Computer Sciences from Polytechnic University, Hawthorne, NY.