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.
- AspectJ home page. http://eclipse.org/aspectj/.Google Scholar
- Awt api. http://java.sun.com/j2se/1.3/docs/api/java/awt/package-summary.html.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- G. Bracha and G. Lindstrom. Modularity meets inheritance. Uucs-91-017, University of Utah, Dept. Comp. Sci., Oct. 1991.Google Scholar
- 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 ScholarDigital Library
- W. R. Cook. A Denotational Semantics of Inheritance. Ph.D. thesis, Department of Computer Science, Brown University, Providence, RI, May 1989. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- A. Goldberg and D. Robson. Smalltalk-80: The Language. Addison Wesley, 1989. Google ScholarDigital Library
- 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 ScholarDigital Library
- Y. Ichisugi and A. Tanaka. Difference-based modules: A class independent module mechanism. In Proceedings ECOOP 2002, volume 2374 of LNCS, 2002. Google ScholarDigital Library
- S. E. Keene. Object-Oriented Programming in Common-Lisp. Addison Wesley, 1989. Google ScholarDigital Library
- 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 ScholarDigital Library
- W. LaLonde and J. Pugh. Subclassing ≠ Subtyping ≠ Is-a. Journal of Object-Oriented Programming, 3(5):57--62, Jan. 1991. Google ScholarDigital Library
- R. E. Lopez-Herrejon, D. Batory, and W. Cook. Evaluating support for features in advanced modularization technlogies. In Proceedings ECOOP 2005. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- T. Millstein, M. Reay, and C. Chambers. Relaxed multijava: balancing extensibility and modular typechecking. In Proceedings OOSPLA 2003, pages 224--240. ACM Press. Google ScholarDigital Library
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In : Proceedings OOPSLA 2004, pages 99--115. ACM Press. Google ScholarDigital Library
- The objective-c programming language. http://developer.apple.com/documentation/Cocoa/-Conceptual/ObjectiveC/index.html.Google Scholar
- 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 ScholarDigital Library
- L. J. Pinson and R. S. Wiener. Objective-C. Addison Wesley, 1988.Google Scholar
- 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 Scholar
- Y. Sato and S. Chiba. Loosely-separated "sister" namespaces in java. In Proceedings ECOOP 2005. Google ScholarDigital Library
- Scala home page. http://lamp.epfl.ch/scala/.Google Scholar
- 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 ScholarDigital Library
- Swing api. http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/package-summary.html.Google Scholar
- 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 Scholar
- M. VanHilst and D. Notkin. Using Role Components to Implement Collaboration-Based Designs. In Proceedings OOPSLA '96, pages 359--369. ACM Press, 1996. Google ScholarDigital Library
- M. Zenger. Evolving software with extensible modules. In International Workshop on Unanticipated Software Evolution, Malaga, Spain, June 2002.Google Scholar
- M. Zenger. Programming Language Abstractions for Extensible Software Components. PhD thesis, University of Lausanne, EPFL, 2003.Google Scholar
Index Terms
- Classbox/J: controlling the scope of change in Java
Recommendations
Classbox/J: controlling the scope of change in Java
Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applicationsUnanticipated 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 ...
Method shelters: avoiding conflicts among class extensions caused by local rebinding
AOSD '12: Proceedings of the 11th annual international conference on Aspect-oriented Software DevelopmentA class extension, also known as open classes, allows programmers to modify existing classes and thus it is supported by several programming languages. However, class extensions imply a risk that they supply different definitions for the same method and ...
The java module system: core design and semantic definition
OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applicationsJava has no module system. Its packages only subdivide the class name space, allowing only a very limited form of component-level information hiding and reuse. Two Java Community Processes have started addressing this problem: one describes the runtime ...
Comments