Present-day software systems have to fulfill an increasing number of requirements rendering them more and more complex. Many systems need to anticipate changing contexts (self-adaptive systems) or need to adapt to changing business rules or requirements (self-optimizing systems). 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 object-oriented programs to their changing contexts. In a role-based language, 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 the 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 implementation 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. As a solution, this work presents a simple implementation pattern for role-based objects that does not require a specific runtime system, SCROLL (SCala ROles Language). 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 implementation details of the pattern are hidden in a Scala library and therefore transparent to Scala programmers. The SCROLL library supports roles embedded in structured contexts, so-called compartments. We show that they are specific, hierarchic runtime views, which enables hierarchic view-based programming for free in Scala.
We also discuss how to apply the implementation pattern of SCROLL for other languages, in particular for behavioral modeling languages in MDSD. This discussion shows that the SCROLL pattern can be embedded into the generated code, so that it still is hidden to the developer, but does not require a specific runtime system. Using the pattern in model-driven code generation enables dynamic views for all kinds of modeling languages. And therefore, this paper shows a way how to realize dynamic views for all modeling languages in MDSD.
Identifer | oai:union.ndltd.org:DRESDEN/oai:qucosa:de:qucosa:70772 |
Date | 08 May 2020 |
Creators | Leuthäuser, Max, Aßmann, Uwe |
Publisher | Association for Computing Machinery |
Source Sets | Hochschulschriftenserver (HSSS) der SLUB Dresden |
Language | English |
Detected Language | English |
Type | info:eu-repo/semantics/acceptedVersion, doc-type:conferenceObject, info:eu-repo/semantics/conferenceObject, doc-type:Text |
Rights | info:eu-repo/semantics/openAccess |
Relation | 978-1-4503-3614-7, 10.1145/2802059.2802062 |
Page generated in 0.0018 seconds