Adaptability and Encapsulation in Dynamically-Typed Languages: Taming Reflection and Extension Methods

Camille Teruel 1
1 RMOD - Analyses and Languages Constructs for Object-Oriented Application Evolution
LIFL - Laboratoire d'Informatique Fondamentale de Lille, Inria Lille - Nord Europe
Abstract : Users expect modern software to be both continually available and updated on the fly. Introduction of new features and integration of bug fixes should not trouble the smooth running of an application. Developers also benefit from dynamic mod- ifications of software, e.g. they can adapt code to new unanticipated situations or they can run dynamic analyses to get feedback about the behavior of running applications for monitoring, debugging and optimization purposes. Programming languages and their runtimes should thus provides developers with mechanisms that improve software adaptability. At the same time, the increasing size and complexity of software call for ap- plications made up of many interacting components developed by different parties. In this context, either all components are trusted or each component needs to be properly protected from other ones. For example, a plugin should not be able to manipulate the internal structures or leaks private data of its host application unre- strictedly. Likewise, a malicious library should not be able to corrupt its clients or interfere with their operations. Programming languages should thus provide devel- opers with mechanisms that improve software isolation, such as encapsulation and custom access control policies. The need for dynamic adaptations that can change nearly every aspect of an application on the one hand and the need for properly confined components on the other hand pulls programming language design in two opposite directions: ei- ther more flexibility or more control. This dissertation studies this tension in the context of dynamically-typed object-oriented languages with two language mech- anisms that promote software adaptability: reflection and extension methods. For both mechanisms, we demonstrate their usefulness, their harmful effect on encap- sulation and propose solutions to retain their power while maintaining encapsula- tion.
Document type :
Theses
Complete list of metadatas

Cited literature [45 references]  Display  Hide  Download

https://tel.archives-ouvertes.fr/tel-01290364
Contributor : Lse Lse <>
Submitted on : Friday, March 18, 2016 - 8:43:12 AM
Last modification on : Thursday, February 21, 2019 - 10:52:50 AM
Long-term archiving on : Monday, June 20, 2016 - 1:17:26 AM

Identifiers

  • HAL Id : tel-01290364, version 1

Collections

Citation

Camille Teruel. Adaptability and Encapsulation in Dynamically-Typed Languages: Taming Reflection and Extension Methods. Programming Languages [cs.PL]. Université des Sciences et Technologies de Lille, 2016. English. ⟨tel-01290364⟩

Share

Metrics

Record views

310

Files downloads

309