skip to main content
10.1145/1094811.1094826acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Classbox/J: controlling the scope of change in Java

Published:12 October 2005Publication History

ABSTRACT

Unanticipated changes to complex software systems can introduce anomalies such as duplicated code, suboptimal inheritance relationships and a proliferation of run-time downcasts. Refactoring to eliminate these anomalies may not be an option, at least in certain stages of software evolution. Classboxes are modules that restrict the visibility of changes to selected clients only, thereby offering more freedom in the way unanticipated changes may be implemented, and thus reducing the need for convoluted design anomalies. In this paper we demonstrate how classboxes can be implemented in statically-typed languages like Java. We also present an extended case study of Swing, a Java GUI package built on top of AWT, and we document the ensuing anomalies that Swing introduces. We show how Classbox/J, a prototype implementation of classboxes for Java, is used to provide a cleaner implementation of Swing using local refinement rather than subclassing.

References

  1. AspectJ home page. http://eclipse.org/aspectj/.Google ScholarGoogle Scholar
  2. Awt api. http://java.sun.com/j2se/1.3/docs/api/java/awt/package-summary.html.Google ScholarGoogle Scholar
  3. D. Batory, J. Liu, and J. N. Sarvela. Refinements and multi-dimensional separation of concerns. In Proceedings ESEC/FSE-11, pages 48--57, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Bergel, S. Ducasse, O. Nierstrasz, and R. Wuyts. Classboxes: Controlling visibility of class extensions. Computer Languages, Systems and Structures, 31(3-4):107--126, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Bergel, S. Ducasse, and R. Wuyts. Classboxes: A minimal module model supporting local rebinding. In Proceedings of JMLC 2003, volume 2789 of LNCS, pages 122--131. Springer-Verlag.Google ScholarGoogle Scholar
  6. G. Bracha and G. Lindstrom. Modularity meets inheritance. Uucs-91-017, University of Utah, Dept. Comp. Sci., Oct. 1991.Google ScholarGoogle Scholar
  7. P. S. Canning, W. Cook, W. L. Hill, J. C. Mitchell, and W. G. Olthoff. F-bounded polymorphism for object-oriented programming. In Proceedings of the ACM Conference on Functional Programming and Computer Architecture, pages 273--280, Sept. 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. W. R. Cook. A Denotational Semantics of Inheritance. Ph.D. thesis, Department of Computer Science, Brown University, Providence, RI, May 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Corwin, D. F. Bacon, D. Grove, and C. Murthy. MJ: a rational module system for Java and its applications. In Proceedings OOSPLA 2003, pages 241--254. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. G. DeMichiel and R. P. Gabriel. The common lisp object system: An overview. In J. Bézivin, J.-M. Hullot, P. Cointe, and H. Lieberman, editors, Proceedings ECOOP '87, volume 276 of LNCS, pages 151--170, Paris, France, June 1987. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. Ernst. gbeta -- a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Aarhus, Arhus, Denmark, 1999.Google ScholarGoogle Scholar
  12. R. B. Findler and M. Flatt. Modular object-oriented programming with units and mixins. In Proceedings of the third ACM SIGPLAN international conference on Functional programming, pages 94--104. ACM Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Flatt and M. Felleisen. Units: Cool modules for hot languages. In Proceedings of PLDI '98 Conference on Programming Language Design and Implementation, pages 236--248. ACM Press, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Goldberg and D. Robson. Smalltalk-80: The Language. Addison Wesley, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. I. M. Holland. Specifying reusable components using contracts. In O. L. Madsen, editor, Proceedings ECOOP '92, volume 615 of LNCS, pages 287--308, Utrecht, the Netherlands, June 1992. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Y. Ichisugi and A. Tanaka. Difference-based modules: A class independent module mechanism. In Proceedings ECOOP 2002, volume 2374 of LNCS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. E. Keene. Object-Oriented Programming in Common-Lisp. Addison Wesley, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. B. Kristensen, O. L. Madsen, B. Moller-Pedersen, and K. Nygaard. The BETA programming language. In B. Shriver and P. Wegner, editors, Research Directions in Object-Oriented Programming, pages 7--48. MIT Press, Cambridge, Mass., 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. W. LaLonde and J. Pugh. Subclassing ≠ Subtyping ≠ Is-a. Journal of Object-Oriented Programming, 3(5):57--62, Jan. 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. E. Lopez-Herrejon, D. Batory, and W. Cook. Evaluating support for features in advanced modularization technlogies. In Proceedings ECOOP 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. O. L. Madsen and B. Moller-Pedersen. Virtual classes: A powerful mechanism in object-oriented programming. In Proceedings OOPSLA '89, ACM SIGPLAN Notices, volume 24, pages 397--406, Oct. 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. McDirmid, M. Flatt, and W. Hsieh. Jiazzi: New age components for old fashioned java. In Proceedings OOPSLA 2001, ACM SIGPLAN Notices, pages 211--222, Oct. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. McDirmid and W. C. Hsieh. Aspect-oriented programming with jiazzi. In AOSD '03: Proceedings of the 2nd international conference on Aspect-oriented software development, pages 70--79, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Mezini and K. Ostermann. Conquering aspects with caesar. In Proceedings of the 2nd international conference on Aspect-oriented software development, pages 90--99. ACM Press, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Millstein, M. Reay, and C. Chambers. Relaxed multijava: balancing extensibility and modular typechecking. In Proceedings OOSPLA 2003, pages 224--240. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In : Proceedings OOPSLA 2004, pages 99--115. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. The objective-c programming language. http://developer.apple.com/documentation/Cocoa/-Conceptual/ObjectiveC/index.html.Google ScholarGoogle Scholar
  28. H. Ossher and P. Tarr. Hyper/J: multi-dimensional separation of concerns for java. In Proceedings of the 22nd international conference on Software engineering, pages 734--737. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. L. J. Pinson and R. S. Wiener. Objective-C. Addison Wesley, 1988.Google ScholarGoogle Scholar
  30. C. Prehofer. Feature-oriented programming: A fresh look at objects. In M. Aksit and S. Matsuoka, editors, Proceedings ECOOP '97, volume 1241 of LNCS, pages 419--443, Jyväskylä, June 1997. Springer-Verlag.Google ScholarGoogle Scholar
  31. Y. Sato and S. Chiba. Loosely-separated "sister" namespaces in java. In Proceedings ECOOP 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Scala home page. http://lamp.epfl.ch/scala/.Google ScholarGoogle Scholar
  33. Y. Smaragdakis and D. Batory. Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM TOSEM, 11(2):215--255, Apr. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Swing api. http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/package-summary.html.Google ScholarGoogle Scholar
  35. M. Torgersen. The expression problem revisited --- four new solutions using generics. In M. Odersky, editor, Proceedings ECOOP 2004, LNCS, Oslo, Norway, June 2004. Springer-Verlag.Google ScholarGoogle Scholar
  36. M. VanHilst and D. Notkin. Using Role Components to Implement Collaboration-Based Designs. In Proceedings OOPSLA '96, pages 359--369. ACM Press, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Zenger. Evolving software with extensible modules. In International Workshop on Unanticipated Software Evolution, Malaga, Spain, June 2002.Google ScholarGoogle Scholar
  38. M. Zenger. Programming Language Abstractions for Extensible Software Components. PhD thesis, University of Lausanne, EPFL, 2003.Google ScholarGoogle Scholar

Index Terms

  1. Classbox/J: controlling the scope of change in Java

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
        October 2005
        562 pages
        ISBN:1595930310
        DOI:10.1145/1094811
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 40, Issue 10
          Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications
          October 2005
          531 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1103845
          Issue’s Table of Contents

        Copyright © 2005 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 12 October 2005

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate268of1,244submissions,22%

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader