On the Integration of Classboxes into C#

  • Markus Lumpe
  • Jean-Guy Schneider
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4089)


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).


Virtual Machine Class Point Class Extension Extension Color Public Class 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ancona, D., Lagorio, G., Zucca, E.: Jam – Designing a Java Extension with Mixins. ACM Transactions on Programming Languages and Systems 25(5), 641–712 (2003)CrossRefGoogle Scholar
  2. 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. 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
  4. 4.
    Bergel, A., Ducasse, S., Nierstrasz, O.: Classbox/J: Controlling the Scope of Change in Java. In: Proceedings OOPSLA 2005, San Diego, USA, pp. 177–189. ACM Press, New York (2005)CrossRefGoogle Scholar
  5. 5.
    Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Classboxes: Controlling Visibility of Class Extensions. Journal of Computer Languages, Systems & Structures 31(3–4), 107–126 (2005)zbMATHCrossRefGoogle Scholar
  6. 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. 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. 8.
    European Computer Machinery Association. In: Standard ECMA-334: C# Language Specification, 3rd edn. (June 2005)Google Scholar
  9. 9.
    Findler, R.B., Flatt, M.: Modular Object-Oriented Programming with Units and Mixins. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP 1998). ACM SIGPLAN Notices, vol. 34, pp. 94–104. ACM Press, New York (1998)CrossRefGoogle Scholar
  10. 10.
    Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and Mixins. In: Proceedings POPL 1998, San Diego, pp. 171–183. ACM Press, New York (1998)CrossRefGoogle Scholar
  11. 11.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Reading (1995)Google Scholar
  12. 12.
    Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An Overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–355. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  13. 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. 14.
    Miller, J.S., Ragsdale, S.: The Common Language Infrastructure Annotated Standard. Microsoft.NET Development Series. Addison-Wesley, Reading (2003)Google Scholar
  15. 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. 16.
    Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana-Champaign, Department of Computer Science (1992)Google Scholar
  17. 17.
    Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.: Traits: Composable Units of Behavior. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  18. 18.
    Smith, C., Drossopoulou, S.S.: Chai: Traits for Java-Like Languages. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 453–478. Springer, Heidelberg (2005)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Markus Lumpe
    • 1
  • Jean-Guy Schneider
    • 2
  1. 1.Department of Computer ScienceIowa State UniversityAmesUSA
  2. 2.Faculty of Information & Communication TechnologiesSwinburne University of TechnologyHawthornAustralia

Personalised recommendations