105 research outputs found

    Runtime aspect weaving through metaprogramming

    Get PDF
    technical reportWe describe an extension to the Java language, Handi-Wrap, that supports weaving aspects into code at runtime. Aspects in Handi-Wrap take the form of method wrappers, which allow aspect code to be inserted around method bodies like advice in AspectJ. Handi- Wrap offers several advantages over static aspect languages such as AspectJ. First, aspects can be woven into binary libraries. Second, a wrapper in Handi-Wrap is a first-class Java value, which allows users to exploit Java mechanisms to define and weave wrappers. For example, wrappers can be passed explicit constructor arguments, and wrapper objects can be composed. Finally, methods in all Java classes, including anonymous classes, can be wrapped. A prototype of Handi-Wrap is implemented in a compile-time metaprogramming system for Java, called Maya; we briefly describe how Maya?s features support Handi- Wrap

    Unwoven Aspect Analysis

    Get PDF
    Various languages and tools supporting advanced separation of concerns (such as aspect-oriented programming) provide a software developer with the ability to separate functional and non-functional programmatic intentions. Once these separate pieces of the software have been specified, the tools automatically handle interaction points between separate modules, relieving the developer of this chore and permitting more understandable, maintainable code. Many approaches have left traditional compiler analysis and optimization until after the composition has been performed; unfortunately, analyses performed after composition cannot make use of the logical separation present in the original program. Further, for modular systems that can be configured with different sets of features, testing under every possible combination of features may be necessary and time-consuming to avoid bugs in production software. To solve this testing problem, we investigate a feature-aware compiler analysis that runs during composition and discovers features strongly independent of each other. When the their independence can be judged, the number of feature combinations that must be separately tested can be reduced. We develop this approach and discuss our implementation. We look forward to future programming languages in two ways: we implement solutions to problems that are conceptually aspect-oriented but for which current aspect languages and tools fail. We study these cases and consider what language designs might provide even more information to a compiler. We describe some features that such a future language might have, based on our observations of current language deficiencies and our experience with compilers for these languages

    An aspect-oriented framework for F#

    Get PDF
    This paper presents the research, design and devel- opment of an aspect-oriented framework for F#, a functional programming language developed by Microsoft on the .NET platform[3]. Our framework allows one to insert advice before, after, or around the call to a particular function. We provide two distinct approaches to weaving the advice to the source code: using a monad-based weaver, and using a weaver built on meta- programming technologies

    AOP++: A Generic Aspect-Oriented Programming Framework in C++

    Full text link
    Abstract. This paper presents AOP++, a generic aspect-oriented pro-gramming framework in C++. It successfully incorporates AOP with object-oriented programming as well as generic programming naturally in the framework of standard C++. It innovatively makes use of C++ templates to express pointcut expressions and match join points at com-pile time. It innovatively creates a full-fledged aspect weaver by using template metaprogramming techniques to perform aspect weaving. It is notable that AOP++ itself is written completely in standard C++, and requires no language extensions. With the help of AOP++, C++ programmers can facilitate AOP with only a little effort.

    GAMESPECT: A Composition Framework and Meta-Level Domain Specific Aspect Language for Unreal Engine 4

    Get PDF
    Game engine programming involves a great number of software components, many of which perform similar tasks; for example, memory allocation must take place in the renderer as well as in the creation routines while other tasks such as error logging must take place everywhere. One area of all games which is critical to the success of the game is that of game balance and tuning. These balancing initiatives cut across all areas of code from the player and AI to the mission manager. In computer science, we’ve come to call these types of concerns “cross cutting”. Aspect oriented programming was developed, in part, to solve the problems of cross cutting: employing “advice” which can be incorporated across different pieces of functionality. Yet, despite the prevalence of a solution, very little work has been done to bring cross cutting to game engine programming. Additionally, the discipline involves a heavy amount of code rewriting and reuse while simultaneously relying on many common design patterns that are copied from one project to another. In the case of game balance, the code may be wildly different across two different games despite the fact that similar tasks are being done. These two problems are exacerbated by the fact that almost every game engine has its own custom DSL (domain specific language) unique to that situation. If a DSL could showcase the areas of cross cutting concerns while highlighting the ability to capture design patterns that can be used across games, significant productivity savings could be achieved while simultaneously creating a common thread for discussion of shared problems within the domain. This dissertation sought to do exactly that- create a metalanguage called GAMESPECT which supports multiple styles of DSLs while bringing aspect-oriented programming into the DSL’s to make them DSAL (domain specific aspect languages). The example cross cutting concern was game balance and tuning since it’s so pervasive and important to gaming. We have created GAMESPECT as a language and a composition framework which can assist engine developers and game designers in balancing their games, forming one central place for game balancing concerns even while these concerns may cross different languages and locations inside the source code. Generality was measured by showcasing the composition specifications in multiple contexts and languages. In addition to evaluating generality and performance metrics, effectiveness was be measured. Specifically, comparisons were made between a balancing initiative when performed with GAMESPECT vs a traditional methodology. In doing so, this work shows a clear advantage to using a Metalanguage such as GAMESPECT for this task. In general, a line of code reduction of 9-40% per task was achieved with negligible effects to performance. The use of a metalanguage in Unreal Engine 4 is a starting point to further discussions concerning other game engines. In addition, this work has implications beyond video game programming. The work described highlights benefits which might be achieved in other disciplines where design pattern implementations and cross-cutting concern usage is high; the real time simulation field and the field of Windows GUI programming are two examples of future domains

    Manipulating Code Annotations

    Get PDF
    This thesis concerns language theory and metaprogramming, more specifically, a kind of metaprogramming performed during program execution. This thesis proposes a technique that help simplify and partially automate many tasks involved on these two aspects of software design and development. A powerful and smart metaprogramming mechanism, which works at runtime on virtual machine level, and which is applicable to any language supported by the virtual machine itself is provided. The mechanism is based on simple source code annotations. Applications of this technique varies from code specialization to code reuse and deployment. Different examples of application are provided

    A decision tree-based approach to dynamic pointcut evaluation

    Get PDF
    Constructs of dynamic nature, e.g., history-based pointcuts and control-flow based pointcuts, have received significant attention in recent aspect-oriented literature. A variety of compelling use cases are presented that motivate the need for efficiently supporting such constructs in language implementations. The key challenge in implementing dynamic constructs is to efficiently support runtime adaptation of the set of intercepted join points at a fine-grained level. This translates to two high-level requirements. First, since the set of intercepted join points may change, such implementations must provide an efficient method to determine this set membership, i.e., whether the currently executing join point needs to be intercepted. Second, the frequency with which such set membership needs to be determined must be minimized. In previous work, Dyer and Rajan proposed a dedicated caching mechanism to address the second requirement. In this work, we propose a mechanism to address the first requirement. This requirement translates to efficiently evaluating whether a join point is intercepted by a set of pointcut expressions. In the worst case, at every join point there may be the need to determine whether it is intercepted. Therefore, even modest savings in such mechanisms is likely to translate to significant savings in the long run

    UML Reflections

    Get PDF
    The UML shares with reflective architectures the idea that self-definition of languages and systems is a key principle for building and maintaining complex systems. The UML is now defined by a four-layer metalevel structure, enabling a flexible and extensible definition of models by metamodels, and even a self-description of the meta-metamodel (the MOF). This metalevel dimension of UML is currently restricted to structural reflection. But recently a new extension to the UML, called the Action Semantics (AS), has been proposed for standardization to the OMG. This paper explores how this proposed extension brings a behavioural reflection dimension to the UML. Indeed, we show that it is not only possible but quite e#ective to use the AS for manipulating UML models (including the AS metamodel). Besides elegant conceptual achievements, such as a metacircular definition of the AS, reflective modeling with the AS leverages on the UML metalevel architecture to provide the benefits of a reflective approach, in terms of separation of concerns, within a mainstream industrial context. A complete model can now be built as an ideal model representing the core concepts in the application, to which non-functional requirements are integrated as fully traceable transformations over this ideal model. For example, this approach paves the way for powerful UML-defined semantics-based model transformations such as refactoring, aspect weaving, application of design patterns or round-trip engineering
    corecore