On the Integration of Classboxes into C#
Classboxes are a new module system for object-oriented languages defining a packaging and scoping mechanism for controlling the visibility of isolated extensions to portions of class-based systems. Unlike object-oriented specialization, the class extension mechanisms supported by classboxes preserve the identity of extended classes and, therefore, all clients of extended classes can benefit from the applied extensions. In this paper, we present a language design and a corresponding implementation strategy for classboxes in C#. A particular challenge in incorporating classboxes into C# is to preserve the identity of extended classes as the .NET framework represents classes as metadata type declarations and access to classes by static links into metadata of the host assembly. However, the local refinement of an imported class results in a new metadata type declaration. In order to guarantee the identity of extended classes, new metadata type declarations have to be incorporated into the original metadata of imported classes. But this “re-wiring” has to occur in a manner that is consistent with the Common Language Infrastructure (CLI).
KeywordsVirtual Machine Class Point Class Extension Extension Color Public Class
Unable to display preview. Download preview PDF.
- 2.Bergel, A.: Classboxes — Controlling Visibility of Class Extensions. PhD thesis, University of Bern, Institute of Computer Science and Applied Mathematics (November 2005)Google Scholar
- 3.Bergel, A., Ducasse, S.: Supporting Unanticipated Changes with Traits and Classboxes. In: Proceedings of Net.ObjectDays (NODE 2005), Erfurt, Germany, pp. 61–75 (September 2005)Google Scholar
- 6.Bracha, G., Cook, W.: Mixin-based Inheritance. In: Meyrowitz, N. (ed.) Proceedings OOPSLA/ECOOP 1990. ACM SIGPLAN Notices, vol. 25, pp. 303–311 (October 1990)Google Scholar
- 7.Clifton, C.: A Design Discipline and Language Features for Modular Reasoning in Aspect-oriented Programs. PhD thesis, Iowa State University, Department of Computer Science (July 2005)Google Scholar
- 8.European Computer Machinery Association. In: Standard ECMA-334: C# Language Specification, 3rd edn. (June 2005)Google Scholar
- 11.Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Reading (1995)Google Scholar
- 13.Lumpe, M., Schneider, J.-G.: Classboxes – An Experiment in Modeling Compositional Abstractions using Explicit Contexts. In: Barnett, M., Edwards, S., Giannakopoulou, D., Leavens, G.T., Sharygina, N. (eds.) Proceedings of ESEC 2005 Workshop on Specification and Verification of Component-Based Systems (SAVCBS 2005), Lisbon, Portugal, pp. 47–54 (September 2005)Google Scholar
- 14.Miller, J.S., Ragsdale, S.: The Common Language Infrastructure Annotated Standard. Microsoft.NET Development Series. Addison-Wesley, Reading (2003)Google Scholar
- 15.Odersky, M., Altherr, P., Cremet, V., Emir, B., Maneth, S., Micheloud, S., Mihaylov, N., Scinz, M., Stenman, E., Zenger, M.: An Overview of the Scala Programming Language. Technical Report IC/2004/64, École Polytechnique Fédérale de Lausanne, School of Computer and Communication Sciences (2004)Google Scholar
- 16.Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign, Department of Computer Science (1992)Google Scholar