Reflective programming is becoming popular due to the increasing set of dynamic services provided by execution environments like JVM and CLR. With custom attributes Microsoft introduced an extensible model of reflection for CLR: they can be used as additional decorations on element declarations. The same notion has been introduced in Java 1.5. The extensible model proposed in both platforms limits annotations to class members. In this paper we describe [a]C#, 1 an extension of the C# programming language, that allows programmers to annotate statements or code blocks and retrieve these annotations at run-time. We show how this extension can be reduced to the existing model. A set of operations on annotated code blocks to retrieve annotations and manipulate bytecode is introduced. Finally, we discuss how to use [a]C# to annotate programs giving hints on how to parallel a sequential method and how it can be implemented by means of the abstractions provided by the run-time of the language. Copyright 2005 ACM.
[a]c#: c# with a Customizable Code Annotation Mechanism / W. Cazzola, A. Cisternino, D. Colombo - In: Proceedings of the 2005 ACM symposium on Applied computing table of contents : Santa Fe, New Mexico / [a cura di] L.M. Liebrock. - New York : ACM Press, 2005. - ISBN 1581139640. - pp. 1264-1268 (( convegno ACM Symposium on Applied Computing tenutosi a Sante Fe, NM nel 2005 [10.1145/1066677.1066964].
[a]c#: c# with a Customizable Code Annotation Mechanism
W. CazzolaPrimo
;
2005
Abstract
Reflective programming is becoming popular due to the increasing set of dynamic services provided by execution environments like JVM and CLR. With custom attributes Microsoft introduced an extensible model of reflection for CLR: they can be used as additional decorations on element declarations. The same notion has been introduced in Java 1.5. The extensible model proposed in both platforms limits annotations to class members. In this paper we describe [a]C#, 1 an extension of the C# programming language, that allows programmers to annotate statements or code blocks and retrieve these annotations at run-time. We show how this extension can be reduced to the existing model. A set of operations on annotated code blocks to retrieve annotations and manipulate bytecode is introduced. Finally, we discuss how to use [a]C# to annotate programs giving hints on how to parallel a sequential method and how it can be implemented by means of the abstractions provided by the run-time of the language. Copyright 2005 ACM.Pubblicazioni consigliate
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.