کد مقاله کد نشریه سال انتشار مقاله انگلیسی نسخه تمام متن
434310 1441700 2013 31 صفحه PDF دانلود رایگان
عنوان انگلیسی مقاله ISI
Safe uniform proxies for Java
موضوعات مرتبط
مهندسی و علوم پایه مهندسی کامپیوتر نظریه محاسباتی و ریاضیات
پیش نمایش صفحه اول مقاله
Safe uniform proxies for Java
چکیده انگلیسی

The proxy abstraction has a long-lasting tradition in object-oriented programming. From design patterns to inherent programming language support, and from remote method invocations to simple forms of behavioral reflection, incarnations as well as applications of proxies are innumerable.Since version 1.3, Java has supported the concept of a dynamic proxy. Such an object conforms to a set of types specified by the program and can be used wherever an expression of any of these types is expected, yet it reifies invocations performed on it. This ability has allowed dynamic proxies to be used to implement paradigms such as behavioral reflection, structural conformance, or multi-methods. Alas, these proxies are only available “for interfaces”. The case of creating dynamic proxies for a set of types including a class has not been addressed, meaning that it is currently not possible to create a dynamic proxy that conforms to an application-defined class type. This weakness strongly limits any application of dynamic proxies beyond the inherent limitations of proxies, which have motivated deeper programming language support for features such as behavioral reflection.In this paper, we unfold the current support for dynamic proxies in Java, assessing it in the light of a set of generic criteria for proxy implementations. We present an approach to supporting dynamic proxies “for classes”, consisting in transformations performed on classes at load-time, including a generic scheme for enforcing encapsulation upon field accesses. These transformations seamlessly extend the scope of the current support for dynamic proxies from the programmer’s perspective. We argue for the safety of our transformations, and discuss the precise benefits and costs of our extension in terms of the criteria introduced through an implementation of future method invocations balancing safety and transparency.

ناشر
Database: Elsevier - ScienceDirect (ساینس دایرکت)
Journal: Science of Computer Programming - Volume 78, Issue 9, 1 September 2013, Pages 1490-1520