Resolving the Java Representation Exposure Problem with an AST-Based Deep Copy and Flexible Alias Ownership System

Yung-Yu Zhuang, Wei Kuo, Shang-Chun Tseng, Hsi-Min Chen,Shang-Pin Ma

ELECTRONICS(2024)

引用 0|浏览0
暂无评分
摘要
Encapsulation is a critical factor in object-oriented programming languages and design patterns. Nevertheless, programs written in languages like Java may encounter broken encapsulation due to the lack of sufficient supply for ownership and immutability. As a result, this paper introduces SlimeJava, an ownership system extension based on abstract syntax trees and annotation utilization of Java that aims to help programmers prevent representation exposure. We show the features of the proposal with a motivating example using the Memento pattern. We then discuss how the utilization of annotations realizes ownership and why it is effective in avoiding representation exposure issues by comparing it with existing approaches. In the end, a quantitative performance evaluation was conducted to prove that SlimeJava does not cause a substantial overhead in execution time compared to native Java.
更多
查看译文
关键词
Java,encapsulation,representation exposure,design pattern,immutability,ownership
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要