ABSTRACT
This paper introduces the expander, a new object-oriented (OO) programming language construct designed to support object adaptation. Expanders allow existing classes to be noninvasively updated with new methods, fields, and superinterfaces. Each client can customize its view of a class by explicitly importing any number of expanders. This view then applies to all instances of that class, including objects passed to the client from other components. A form of expander overriding allows expanders to interact naturally with OO-style inheritance.We describe the design, implementation, and evaluation of eJava, an extension to Java supporting expanders. We illustrate eJava's syntax and semantics through several examples. The statically scoped nature of expander usage allows for a modular static type system that prevents several important classes of errors. We describe this modular static type system informally, formalize eJava and its type system in an extension to Featherweight Java, and prove a type soundness theorem for the formalization. We also describe a modular compilation strategy for eJava, which we have implemented using the Polyglot extensible compiler framework. Finally, we illustrate the practical benefits of eJava by using this compiler in two experiments.
- G. Baumgartner, M. Jansche, and K. Laufer. Half & Half: Multiple dispatch and retroactive abstraction for Java. Technical Report OSU-CISRC-5/01-TR08, Department of Computer and Information Science, The Ohio State University, revised March 2002.]]Google Scholar
- A. Bergel. Personal communication, Oct. 2005.]]Google Scholar
- A. Bergel, S. Ducasse, and O. Nierstrasz. Classbox/J: Controlling the scope of change in Java. In Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'05), pages 177--189, New York, NY, USA, 2005. ACM Press.]] Google Scholar
Digital Library
- A. Bergel, S. Ducasse, and R. Wuyts. Classboxes: A minimal module model supporting local rebinding. In Proceedings of JMLC 2003 (Joint Modular Languages Conference), volume 2789 of LNCS, pages 122--131. Springer-Verlag, 2003. Best Award Paper.]]Google Scholar
Cross Ref
- G. Bracha and W. Cook. Mixin-based inheritance. In ECOOP/OOPSLA '90, pages 303--311, 1990.]] Google Scholar
Digital Library
- C. Clifton, G. T. Leavens, C. Chambers, and T. Millstein. MultiJava: Modular open classes and symmetric multiple dispatch for Java. In OOPSLA 2000 Conference on Object-Oriented Programming, Systems, Languages, and Applications, Minneapolis, Minnesota, volume 35(10) of ACM SIGPLAN Notices, pages 130--145, Oct. 2000.]] Google Scholar
Digital Library
- C. Clifton, T. Millstein, G. T. Leavens, and C. Chambers. MultiJava: Design rationale, compiler implementation, and applications. ACM Trans. Program. Lang. Syst., 28(3):517--575, 2006.]] Google Scholar
Digital Library
- Eclipse home page. http://www.eclipse.org.]]Google Scholar
- Eclipse Bug System home page. https://bugs.eclipse.org/bugs.]]Google Scholar
- E. Ernst. Family polymorphism. In Proceedings of the European Conference on Object-Oriented Programming, pages 303--326, 2001.]] Google Scholar
Digital Library
- E. Ernst. Higher-order hierarchies. In Proceedings of the European Conference on Object-Oriented Programming, LNCS, Darmstadt, Germany, July 2003. Springer Verlag.]]Google Scholar
- R. B. Findler and M. Flatt. Modular object-oriented programming with units and mixins. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP '98), volume 34(1) of ACM SIGPLAN Notices, pages 94--104. ACM, June 1998.]] Google Scholar
Digital Library
- M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In Conference Record of POPL 98: The 25TH ACM SIGPLAN -SIGACT Symposium on Principles of Programming Languages, San Diego, California, pages 171--183, New York, NY, 1998.]] Google Scholar
Digital Library
- E. Gamma and K. Beck. Contributing to Eclipse: Principles, Patterns, and Plugins. Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA, 2003.]] Google Scholar
Digital Library
- E. Gamma, R. Helm, R. E. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Massachusetts, 1995.]] Google Scholar
Digital Library
- J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java Language Specification, Third Edition. Addison-Wesley, 2005.]] Google Scholar
Digital Library
- W. Harrison and H. Ossher. Subject-oriented programming (A critique of pure objects). In A. Paepcke, editor, Proceedings ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 411--428. ACM Press, Oct. 1993.]] Google Scholar
Digital Library
- A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396--450, May 2001.]] Google Scholar
Digital Library
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In Proceedings of the 2001 European Conference on Object-Oriented Programming, LNCS 2072, Budapest, Hungary, June 2001. Springer-Verlag.]] Google Scholar
Digital Library
- S. McDirmid, M. Flatt, and W. C. Hsieh. Jiazzi: New-age components for old-fashioned Java. In Proceedings of the OOPSLA '01 conference on Object Oriented Programming Systems Languages and Applications, pages 211--222. ACM Press, 2001.]] Google Scholar
Digital Library
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN Conference on Object-oriented programming, systems, languages, and applications, pages 99--115. ACM Press, 2004.]] Google Scholar
Digital Library
- N. Nystrom, M. R. Clarkson, and A. C. Myers. Polyglot: An extensible compiler framework for Java. In Proceedings of CC 2003: 12'th International Conference on Compiler Construction. Springer-Verlag, Apr. 2003.]]Google Scholar
Digital Library
- M. Odersky and M. Zenger. Scalable component abstractions. In OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming systems languages and applications, pages 41--57, New York, NY, USA, 2005. ACM Press.]] Google Scholar
Digital Library
- H. Ossher, M. Kaplan, A. Katz, W. Harrison, and V. Kruskal. Specifying subject-oriented composition. Theor. Pract. Object Syst., 2(3):179--202, 1996.]] Google Scholar
Digital Library
- H. Ossher and P. Tarr. Hyper/J: Multi-dimensional separation of concerns for Java. In Proceedings of the 22nd International Conference on Software Engineering, June 4-11, 2000, Limerick, Ireland, pages 734--737, 2000.]] Google Scholar
Digital Library
- Polyglot for Java 1.5 home page. http://www.sable.mcgill.ca/~jlhotak/polyglot-custom.]]Google Scholar
- The Scala language home page. http://scala.epfl.ch.]]Google Scholar
- N. Schärli, S. Ducasse, O. Nierstrasz, and A. Black. Traits: Composable units of behavior. In Proceedings ECOOP 2003 (European Conference on Object-Oriented Programming), volume 2743 of LNCS, pages 248--274. Springer Verlag, July 2003.]]Google Scholar
Cross Ref
- Y. Smaragdakis and D. Batory. Implementing layered designs with mixin layers. In E. Jul, editor, ECOOP '98 Object-Oriented Programming, LNCS 1445, pages 550--570. Springer, 1998.]] Google Scholar
Digital Library
- P. Tarr, H. Ossher, W. Harrison, and J. Stanley M. Sutton. N degrees of separation: multi-dimensional separation of concerns. In ICSE '99: Proceedings of the 21st international conference on Software engineering, pages 107--119, Los Alamitos, CA, USA, 1999. IEEE Computer Society Press.]] Google Scholar
Digital Library
- K. K. Thorup and M. Torgersen. Unifying genericity: Combining the benefits of virtual types and parameterized classes. In R. Guerraoui, editor, Proceedings ECOOP '99, volume 1628 of LNCS, pages 186--204, Lisbon, Portugal, June 1999. Springer-Verlag.]] Google Scholar
Digital Library
- M. Torgersen. Virtual types are statically safe. In International Workshop on Foundations of Object-Oriented Languages (FOOL), informal proceedings, Jan. 1998.]]Google Scholar
- A. Warth and T. Millstein. Featherweight eJava. Technical Report CSD-TR-060013, UCLA Computer Science Department, 2006. ftp://ftp.cs.ucla.edu/tech-report/2006-reports/060013.pdf.]]Google Scholar
- A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, Nov. 1994.]] Google Scholar
Digital Library
Index Terms
Statically scoped object adaptation with expanders
Recommendations
Statically scoped object adaptation with expanders
Proceedings of the 2006 OOPSLA ConferenceThis paper introduces the expander, a new object-oriented (OO) programming language construct designed to support object adaptation. Expanders allow existing classes to be noninvasively updated with new methods, fields, and superinterfaces. Each client ...
Relaxed MultiJava: balancing extensibility and modular typechecking
OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applicationsWe present the rationale, design, and implementation of Relaxed MultiJava (RMJ), a backward-compatible extension of Java that allows programmers to add new methods to existing classes and to write multimethods. Previous languages supporting these forms ...
Relaxed MultiJava: balancing extensibility and modular typechecking
Special Issue: Proceedings of the OOPSLA '03 conferenceWe present the rationale, design, and implementation of Relaxed MultiJava (RMJ), a backward-compatible extension of Java that allows programmers to add new methods to existing classes and to write multimethods. Previous languages supporting these forms ...







Comments