14 research outputs found

    Towards safe and flexible object adaptation

    Full text link
    In this paper, a programming language NextEJ is proposed. NextEJ is based on Epsilon model, which realizes object adaptation to contexts. The novelty of Epsilon model is its ability to make objects be able to freely enter or leave contexts dynamically and belong to multiple contexts at a time. However, such kind of flexibility also easily brings type-unsafety. NextEJ tackles this problem by introduc-ing a new feature called context activation scope. Inside a context activation scope, it is assured that an object is al-ways bound with the role activated so that no method-not-understood errors occur at run-time. Furthermore, context activation scope can be nested so that multiple contexts can be activated at a time. A role instance has a pre-defined field thisContext which refers to its enclosing context instance. In the case of multiple context activations, the reference of thisContext is interpreted as a composite context whose behavior is determined by the order of activations

    Session-Based Role Programming for the Design of Advanced Telephony Applications

    Get PDF
    International audienceStimulated by new protocols like SIP, telephony applications are rapidly evolving to o er and combine a variety of communications forms including presence status, instant messaging and videoconferencing. This situation changes and complicates significantly the programming of telephony applications that consist now of distributed entities involved into multiple heterogeneous, stateful and long-running interactions. This paper proposes an approach to support the development of SIP-based telephony applications based on general programming language. Our approach combines the concepts of Actor, Session and Role. Role is the part an actor takes in a session and we consider a session as a collaboration between roles. By using these concepts, we are able to break the complexity of SIP entities programming and provide flexibility for defi ning new ones. Our approach is implemented as a coding framework above JAIN-SIP

    A CONTEXT-AWARE ROLE-PLAYING AUTOMATON FOR SELF-ADAPTIVE SYSTEMS

    Get PDF
    Role-based modeling and programming will become more and more important to realize big, complex, and adaptive software systems [Zhu and Alkins, 2006]. Therefore, the Object-Oriented Programming (OOP) paradigm is extended with roles, where objects can begin to play roles and drop roles dynamically at runtime. Playing a role is changing the object’s type which can add or change behavior. Roles are a dynamic view of the state and behavior of objects at runtime at a point of time highlighting their relations to other objects. Self-adaptive systems (SAS) are naturally context-aware systems. Thus, adaption is always seen in a context e.g., because a sensor value passes a specified limit, or because the reason could be derived from the knowledge about the past and presence. However, there is currently no common concept describing the situation (e.g., the context or other conditions that lead to a specific adaption) in which objects begin to play and stop playing roles. Current role programming languages therefore suffer from the problem of tangling of different aspects i.e., the context logic, the role adaption logic, and the business logic. This leads to less understandable and unmaintainable code [Antinyan et al., 2014]. Thomas Kühn has drafted in his major thesis [Kühn, 2011] a behavioral model to describe role binding with storyboards. This allows to model concisely role reconfigurations, but the concept lacks the ability to specify context-dependent behavior which is crucial for self-adaptive systems, and is built on top of an outdated understanding of the role concept which lacks compartments. The concept of storyboards will be extended with the ability to address context-dependent conditions. Compartments will be added in order to adapt the current wider understanding of the concept of roles. This will result in a concept for context-aware storyboards with roles which provide a separation of concerns approach w.r.t. the above named concerns. The concept will be implemented as automaton and will be evaluated on a use case. The use case is a robotic co-working scenario based on the idea of [Haddadin et al., 2009].:1. Introduction 1.1. Motivation 1.2. Outline 2. Background and Concepts 2.1. Role-Based Design 2.1.1. Roles and Role Models 2.1.2. Role Binding 2.1.3. Role Runtime Systems 2.2. Modeling Concepts for a Role-Playing Automaton 2.2.1. Models and Meta-models 2.2.2. Behavioral Diagrams and Automata 2.2.3. Storyboards 2.3. Relevant Software Architectures 2.3.1. Context-Aware Computing 2.3.2. Self-Adaptive Systems 2.3.3. Event-Based Systems 2.4. Summary 3. Requirements Analysis 3.1. Problem Analysis 3.2. Goals and Requirements 3.3. Technology Analysis and Selection 3.3.1. Pattern Matching 3.3.2. Model Execution 3.4. Summary 4. Concept for a Role-Playing Automaton for Self-Adaptive Systems 4.1. Context-Aware Storyboards with Roles 4.2. Syntax and Semantics 4.2.1. Overview 4.2.2. Story Pattern 4.2.3. Transitions, Events, and Guards 4.2.4. Control Nodes 4.2.5. Variable Binding 4.3. Meta-Model 4.4. Differences to Related Concepts 4.4.1. Relation to UML Activity Diagrams 4.4.2. Differences to Story Diagrams 4.4.3. Differences to Storyboards with Roles 4.5. Summary 5. Implementation 5.1. Architecture 5.2. Implementation 5.2.1. Grammar and Meta-model 5.2.2. Model Transformation 5.2.3. Graph Transformation 5.2.4. The Role Model 5.2.5. Context and Events 5.2.6. Model Execution and Validation 5.3. Summary 6. Related Work 6.1. Context-Aware Middleware for URC System 6.2. Context Petri Nets 6.3. Agent-Based and Context-Oriented Approach for Web Services Composition 6.4. Model Driven Design of Service-Based Context-Aware Applications 6.5. Summary 7. Evaluation 7.1. Use Case Robotic Co-Worker 7.2.Results 7.3.Summary 8. Conclusion and FutureWork 8.1.Conclusion 8.2.FutureWork A. Appendices A.1. Grammar for Storyboards with Roles A.2. Exemplary of a StoryDiagram A.3. Meta-Model of Context-Aware Storyboards With Role

    Run-time Variability with Roles

    Get PDF
    Adaptability is an intrinsic property of software systems that require adaptation to cope with dynamically changing environments. Achieving adaptability is challenging. Variability is a key solution as it enables a software system to change its behavior which corresponds to a specific need. The abstraction of variability is to manage variants, which are dynamic parts to be composed to the base system. Run-time variability realizes these variant compositions dynamically at run time to enable adaptation. Adaptation, relying on variants specified at build time, is called anticipated adaptation, which allows the system behavior to change with respect to a set of predefined execution environments. This implies the inability to solve practical problems in which the execution environment is not completely fixed and often unknown until run time. Enabling unanticipated adaptation, which allows variants to be dynamically added at run time, alleviates this inability, but it holds several implications yielding system instability such as inconsistency and run-time failures. Adaptation should be performed only when a system reaches a consistent state to avoid inconsistency. Inconsistency is an effect of adaptation happening when the system changes the state and behavior while a series of methods is still invoking. A software bug is another source of system instability. It often appears in a variant composition and is brought to the system during adaptation. The problem is even more critical for unanticipated adaptation as the system has no prior knowledge of the new variants. This dissertation aims to achieve anticipated and unanticipated adaptation. In achieving adaptation, the issues of inconsistency and software failures, which may happen as a consequence of run-time adaptation, are evidently addressed as well. Roles encapsulate dynamic behavior used to adapt players representing the base system, which is the rationale to select roles as the software system's variants. Based on the role concept, this dissertation presents three mechanisms to comprehensively address adaptation. First, a dynamic instance binding mechanism is proposed to loosely bind players and roles. Dynamic binding of roles enables anticipated and unanticipated adaptation. Second, an object-level tranquility mechanism is proposed to avoid inconsistency by allowing a player object to adapt only when its consistent state is reached. Last, a rollback recovery mechanism is proposed as a proactive mechanism to embrace and handle failures resulting from a defective composition of variants. A checkpoint of a system configuration is created before adaptation. If a specialized bug sensor detects a failure, the system rolls back to the most recent checkpoint. These mechanisms are integrated into a role-based runtime, called LyRT. LyRT was validated with three case studies to demonstrate the practical feasibility. This validation showed that LyRT is more advanced than the existing variability approaches with respect to adaptation due to its consistency control and failure handling. Besides, several benchmarks were set up to quantify the overhead of LyRT concerning the execution time of adaptation. The results revealed that the overhead introduced to achieve anticipated and unanticipated adaptation to be small enough for practical use in adaptive software systems. Thus, LyRT is suitable for adaptive software systems that frequently require the adaptation of large sets of objects

    A Dynamic Instance Binding Mechanism Supporting Run-Time Variability of Role-Based Software Systems

    Get PDF
    Role-based approaches gain more and more interest for modeling and implementing variable software systems. Role models clearly separate static behavior represented by players and dynamic behavior modeled as roles which can be dynamically bound and unbound to players at run time. To support the execution of role-based systems, a dynamic binding mechanism is required. Especially, since instances of the same player type can play different roles in a single context, the binding mechanism is required to operate at instance level. In this paper, we introduce a mechanism called dynamic instance binding for implementing a runtime for role-based systems. It maintains a look-up table that allows the run-time system to determine and invoke the currently active role binding at instance level. We explain dynamic instance binding mechanism in detail and demonstrate that it is flexible enough to support both adaptation and evolution of software systems at run time

    Efficient Dispatch of Multi-object Polymorphic Call Sites in Contextual Role-Oriented Programming Languages

    Get PDF
    Adaptive software becomes more and more important as computing is increasingly context-dependent. Runtime adaptability can be achieved by dynamically selecting and applying context-specific code. Role-oriented programming has been proposed as a paradigm to enable runtime adaptive software by design. Roles change the objects’ behavior at runtime, thus adapting the software to a given context. The cost of adaptivity is however a high runtime overhead stemming from executing compositions of behavior-modifying code. It has been shown that the overhead can be reduced by optimizing dispatch plans at runtime when contexts do not change, but no method exists to reduce the overhead in cases with high context variability. This paper presents a novel approach to implement polymorphic role dispatch, taking advantage of run-time information to effectively guard abstractions and enable reuse even in the presence of variable contexts. The concept of polymorphic inline caches is extended to role invocations. We evaluate the implementation with a benchmark for role-oriented programming languages achieving a geometric mean speedup of 4.0× (3.8× up to 4.5×) with static contexts, and close to no overhead in the case of varying contexts over the current implementation of contextual roles in Object Team

    Reusable roles, a test with patterns

    Get PDF
    Although roles have been around for a long time they have not yet reached mainstream programming languages. The variety of existing role models may be a limiting factor. We believe that for roles to be widely accepted they must enhance code reuse. An outcome would be a library of roles. We present and discuss what we feel are the characteristics that a role model must have to enable reusable and player independent roles. In this paper we present our role model and JavaStage, a role language that extends Java, with examples of reusable roles. Finally, we present our steps towards the building of a role library, by presenting the roles developed from the analysis of the GoF Design Patterns. The results obtained, we developed roles for 10 of the 23 GoF patterns, are promising

    A prototype-based approach to object evolution

    Get PDF
    International audienceWe investigate, in the context of functional prototype-based languages , a calculus of objects which might extend themselves upon receiving a message, a possibility referred to by Cardelli as a self-inflicted operation. We present a sound type system for this calculus which guarantees that evaluating a well-typed expression will never yield a message-not-found runtime error. The resulting calculus is an attempt towards the definition of a language combining the safety advantage of static type check with the flexibility normally found in dynamically typed languages

    A Pure Embedding of Roles: Exploring 4-dimensional Dispatch for Roles in Structured Contexts

    Get PDF
    Present-day software systems have to fulfill an increasing number of requirements, which makes them more and more complex. Many systems need to anticipate changing contexts or need to adapt to changing business rules or requirements. The challenge of 21th-century software development will be to cope with these aspects. We believe that the role concept offers a simple way to adapt an object-oriented program to its changing context. In a role-based application, an object plays multiple roles during its lifetime. If the contexts are represented as first-class entities, they provide dynamic views to the object-oriented program, and if a context changes, the dynamic views can be switched easily, and the software system adapts automatically. However, the concepts of roles and dynamic contexts have been discussed for a long time in many areas of computer science. So far, their employment in an existing object-oriented language requires a specific runtime environment. Also, classical object-oriented languages and their runtime systems are not able to cope with essential role-specific features, such as true delegation or dynamic binding of roles. In addition to that, contexts and views seem to be important in software development. The traditional code-oriented approach to software engineering becomes less and less satisfactory. The support for multiple views of a software system scales much better to the needs of todays systems. However, it relies on programming languages to provide roles for the construction of views. As a solution, this thesis presents an implementation pattern for role-playing objects that does not require a specific runtime system, the SCala ROles Language (SCROLL). Via this library approach, roles are embedded in a statically typed base language as dynamically evolving objects. The approach is pure in the sense that there is no need for an additional compiler or tooling. The implementation pattern is demonstrated on the basis of the Scala language. As technical support from Scala, the pattern requires dynamic mixins, compiler-translated function calls, and implicit conversions. The details how roles are implemented are hidden in a Scala library and therefore transparent to SCROLL programmers. The SCROLL library supports roles embedded in structured contexts. Additionally, a four-dimensional, context-aware dispatch at runtime is presented. It overcomes the subtle ambiguities introduced with the rich semantics of role-playing objects. SCROLL is written in Scala, which blends a modern object-oriented with a functional programming language. The size of the library is below 1400 lines of code so that it can be considered to have minimalistic design and to be easy to maintain. Our approach solves several practical problems arising in the area of dynamical extensibility and adaptation

    Role-Modeling in Round-Trip Engineering for Megamodels

    Get PDF
    Software is becoming more and more part of our daily life and makes it easier, e.g., in the areas of communication and infrastructure. Model-driven software development forms the basis for the development of software through the use and combination of different models, which serve as central artifacts in the software development process. In this respect, model-driven software development comprises the process from requirement analysis through design to software implementation. This set of models with their relationships to each other forms a so-called megamodel. Due to the overlapping of the models, inconsistencies occur between the models, which must be removed. Therefore, round-trip engineering is a mechanism for synchronizing models and is the foundation for ensuring consistency between models. Most of the current approaches in this area, however, work with outdated batch-oriented transformation mechanisms, which no longer meet the requirements of more complex, long-living, and ever-changing software. In addition, the creation of megamodels is time-consuming and complex, and they represent unmanageable constructs for a single user. The aim of this thesis is to create a megamodel by means of easy-to-learn mechanisms and to achieve its consistency by removing redundancy on the one hand and by incrementally managing consistency relationships on the other hand. In addition, views must be created on the parts of the megamodel to extract them across internal model boundaries. To achieve these goals, the role concept of Kühn in 2014 is used in the context of model-driven software development, which was developed in the Research Training Group 'Role-based Software Infrastructures for continuous-context-sensitive Systems.' A contribution of this work is a role-based single underlying model approach, which enables the generation of views on heterogeneous models. Besides, an approach for the synchronization of different models has been developed, which enables the role-based single underlying model approach to be extended by new models. The combination of these two approaches creates a runtime-adaptive megamodel approach that can be used in model-driven software development. The resulting approaches will be evaluated based on an example from the literature, which covers all areas of the work. In addition, the model synchronization approach will be evaluated in connection with the Transformation Tool Contest Case from 2019
    corecore