On flexible dynamic trait replacement for Java-like languages
نویسندگان
چکیده
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 object’s 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 trait replacement operation code and 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.
منابع مشابه
Dynamic Assessment: From Underlying Constructs to Implications for Language Teaching
Testing as a general trait of social life has received a great deal of attention by many language teachers and scholars. Throughout history, people have been tested to prove their abilities and experiences or to confirm their capacities. Many authorities have said that assessment and instruction should be integrated as a single and inseparable activity which seeks to understand development by a...
متن کاملFeatherweight Java with dynamic and static overloading
We propose FMJ (Featherweight Multi Java), an extension of Featherweight Java with encapsulated multi-methods thus providing dynamic overloading. Multi-methods (collections of overloaded methods associated to the same message, whose selection takes place dynamically instead of statically as in standard overloading) are a useful and flexible mechanism which enhances re-usability and separation o...
متن کاملScientific Communication Centre of Innovation in Telecommunications and Integration of services JooFlux: Hijacking Java 7 InvokeDynamic To Support Live Code Modifications
Changing functional and non-functional software implementation at runtime is useful and even sometimes critical both in development and production environments. JooFlux is a JVM agent that allows both the dynamic replacement of method implementations and the application of aspect advices. It works by doing bytecode transformation to take advantage of the new invokedynamic instruction added in J...
متن کاملFlexible Models for Dynamic Linking – Extended Version –
Dynamic linking supports flexible code deployment: partially linked code links further code on the fly, as needed; and thus, end-users receive updates automatically. On the down side, each program run may link different versions of the same code, possibly causing subtle errors which mystify end-users. Dynamic linking in Java and C# are similar: The same linking phases are involved, soundness is...
متن کاملImplementing Dynamic Language Features in Java Using Dynamic Code Generation
Compared to dynamic object-oriented languages like CommonLisp or Smalltalk, Java has a fairly simple and restrictive object and type system. Some of the key differences between Java and these other languages is that they offer structural conformance, automatic delegation, and dynamic mixins. When such constructs are needed in a language like Java, they are usually expressed in terms of standard...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Sci. Comput. Program.
دوره 78 شماره
صفحات -
تاریخ انتشار 2013