Dynamic trait replacement is a programming language feature for changing the objects' behavior at runtime by replacing some of the objects' methods. In previous work on dynamic trait replacement for java-like ...
详细信息
Dynamic trait replacement is a programming language feature for changing the objects' behavior at runtime by replacing some of the objects' methods. In previous work on dynamic trait replacement for java-like languages, the objects' methods that may be replaced must correspond exactly to a named trait used in the object's class definition. In this paper we propose the notion of replaceable: a programming language feature that decouples the trait replacement operation code and the class declaration code, thus making it possible to refactor classes and to perform unanticipated trait replacement operations without invalidating existing code. We give a formal account of our proposal through a core calculus, FDTJ (featherweight DYNAMIC TRAIT java), equipped With a static type system guaranteeing that in a well-typed program no runtime type error will take place. (C) 2012 Elsevier B.V. All rights reserved.
The box model is a lightweight component model for the object-oriented paradigm, which structures the flat object-heap into hierarchical runtime components called boxes. Boxes have clear runtime boundaries that divide...
详细信息
The box model is a lightweight component model for the object-oriented paradigm, which structures the flat object-heap into hierarchical runtime components called boxes. Boxes have clear runtime boundaries that divide the objects of a box into objects that can be used to interact with the box (the boundary objects) and objects that are encapsulated and represent the state of the box (the local objects). The distinction into local and boundary objects is statically achieved by an ownership type system for boxes that uses domain annotations to classify objects into local and boundary objects and that guarantees that local objects can never be directly accessed by the context of a box. A trait is a set of methods divorced from any class hierarchy. Traits are units of fine-grained reuse that can be composed together to form classes or other traits. This paper integrates traits into an ownership type system for boxes. This combination is fruitful in two ways: it can statically guarantee encapsulation of objects and still provide fine-grained reuse among classes that goes beyond the possibilities of standard inheritance. It also solves a specific problem of the box ownership type system: namely that box classes cannot inherit from standard classes (and vice versa), and thus code sharing between these two kinds of classes was not possible in this setting so far. We present an ownership type system and the corresponding soundness proofs that guarantee encapsulation of objects in an object-oriented language with traits. (C) 2011 Elsevier B.V. All rights reserved.
Feature-oriented programming (FOP) is a paradigm that incorporates programming language technology, program generation techniques, and stepwise refinement. In their GPCE'07 paper, Thaker et a]. suggest the develop...
详细信息
ISBN:
(纸本)9781605582672
Feature-oriented programming (FOP) is a paradigm that incorporates programming language technology, program generation techniques, and stepwise refinement. In their GPCE'07 paper, Thaker et a]. suggest the development of a type system for FOP to guarantee safe feature composition, Le, to guarantee the absence of type errors during feature composition. We present such a type system along with a calculus for a simple feature-oriented, java-like language, called Feature featherweight java (FFJ). Furthermore, we explore four extensions of FFJ and how they affect type soundness.
Software product line engineering is an efficient means of generating a family of program variants for a domain from a single code base. However, because of the potentially high number of possible program variants, it...
详细信息
Software product line engineering is an efficient means of generating a family of program variants for a domain from a single code base. However, because of the potentially high number of possible program variants, it is difficult to test them all and ensure properties like type safety for the entire product line. We present a product-line-aware type system that can type check an entire software product line without generating each variant in isolation. Specifically, we extend the featherweight java calculus with feature annotations for product-line development and prove formally that all program variants generated from a well typed product line are well typed. Furthermore, we present a solution to the problem of typing mutually exclusive features. We discuss how results from our formalization helped implement our own product-line tool CIDE for full java and report of our experience with detecting type errors in four existing software product line implementations.
Class inheritance and method overriding, as provided by standard class-based languages, are often not flexible enough to represent objects with some dynamic behavior. In this respect, object composition equipped with ...
详细信息
Class inheritance and method overriding, as provided by standard class-based languages, are often not flexible enough to represent objects with some dynamic behavior. In this respect, object composition equipped with different forms of method body lookup is often advocated as a more flexible alternative to class inheritance since it takes place at run time, thus permitting the behavior of objects to be specialized dynamically. In this paper, we illustrate Incomplete featherweight java (IFJ), an extension of featherweight java with a novel linguistic construct, the incomplete object. Incomplete objects require some missing methods which can be provided at run time by composition with another (complete) object. Furthermore, we present two mechanisms for the method body lookup on (composed) objects, one based on delegation and the other based on consultation. Thanks to the design of the language, the consultation-based lookup is a simple extension of the delegation-based one. Both mechanisms are disciplined by static typing, therefore the language enjoys type safety (which implies no "message-not-understood" run-time errors) and avoids possible accidental overrides due to method name clashes. (C) 2010 Elsevier B.V. All rights reserved.
We present an extension for a java like language with a mechanism for dynamically extending object behaviors. Our approach consists in moving the addition of new features from class (static) level to object (dynamic) ...
详细信息
ISBN:
(纸本)9781595934802
We present an extension for a java like language with a mechanism for dynamically extending object behaviors. Our approach consists in moving the addition of new features from class (static) level to object (dynamic) level: the basic features of entities (representing their structure) are separated from the additional ones (wrapper classes whose instances represent run-time added behaviors). At run-time, these entities can be dynamically composed by instantiating wrapper objects which are attached to basic entities. We formalize our extension by adding the new constructs to featherweight java;the core language so extended (featherweight Wrap java) is type safe.
Fragments of mainstream programming languages are formalised in order to show desirable properties of their static semantics. We ask if said formalisms could also be used to define a test suite for the mainstream prog...
详细信息
Fragments of mainstream programming languages are formalised in order to show desirable properties of their static semantics. We ask if said formalisms could also be used to define a test suite for the mainstream programming language in question, and what the utility of such a suite would be. In this work, we present our findings from testing java with featherweight java (FJ). We take the syntax and binding structure of FJ to define an instance space of non-isomorphic test programs and implementations of FJ type checkers to provide oracles for our tests, to ensure the mainstream implementation conforms with the expectations of FJ. Using these, we evaluate (using code coverage techniques) how much of the Sun OpenJDK javac can be tested by FJ.
Mainly concerned with type safety, featherweight java, or FJ, is a well known minimal core for java and Generic java. However, in the type system of FJ, the treatment of downcast is omitted. In this paper we propose a...
详细信息
ISBN:
(纸本)3540488154
Mainly concerned with type safety, featherweight java, or FJ, is a well known minimal core for java and Generic java. However, in the type system of FJ, the treatment of downcast is omitted. In this paper we propose a stronger type system for FJ and FGJ. In order to deal with the cast problems, we introduce some special techniques for types, and also strengthen the types for expressions and methods in terms of the type declaration notations. Supported by the type system and our techniques, we can ensure properties stronger than the ones proved in Igarashi et al's original FJ paper. Examples making the above mentioned contributions clear are illustrated throughout this paper. Furthermore a case study on design patterns showing the advantages of our results is given.
暂无评论