Skip to main content

JavaGI: Generalized Interfaces for Java

  • Conference paper
ECOOP 2007 – Object-Oriented Programming (ECOOP 2007)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4609))

Included in the following conference series:

Abstract

JavaGI is an experimental language that extends Java 1.5 by generalizing the interface concept to incorporate the essential features of Haskell’s type classes. In particular, generalized interfaces cater for retroactive and constrained interface implementations, binary methods, static methods in interfaces, default implementations for interface methods, interfaces over families of types, and existential quantification for interface-bounded types. As a result, many anticipatory uses of design patterns such as Adapter, Factory, and Visitor become obsolete; several extension and integration problems can be solved more easily. JavaGI’s interface capabilities interact with subtyping (and subclassing) in interesting ways that go beyond type classes. JavaGI can be translated to Java 1.5. Its formal type system is derived from Featherweight GJ.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bracha, G.: Generics in the Java programming language (July 2004), http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

  2. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the Java programming language. In: Proc. 13th ACM Conf. OOPSLA, Vancouver, BC, October 1998, pp. 183–200. ACM Press, New York (1998)

    Google Scholar 

  3. Bruce, K.B., Cardelli, L., Castagna, G., Eifrig, J., Smith, S.F., Trifonov, V., Leavens, G.T., Pierce, B.C.: On binary methods. Theory and Practice of Object Systems 1(3), 221–242 (1995)

    Google Scholar 

  4. Bruce, K.B., Foster, J.N.: LOOJ: Weaving LOOM into Java. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 389–413. Springer, Heidelberg (2004)

    Google Scholar 

  5. Bruce, K.B., Odersky, M., Wadler, P.: A statically safe alternative to virtual types. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 523–549. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  6. Bruce, K.B., Petersen, L., Fiech, A.: Subtyping is not a good ”match” for object-oriented languages. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 104–127. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  7. Bruce, K.B., Schuett, A., van Gent, R., Fiech, A.: PolyTOIL: A type-safe polymorphic object-oriented language. ACM Trans. Prog. Lang. and Systems 25(2), 225–290 (2003)

    Article  Google Scholar 

  8. Chakravarty, M.M.T., Keller, G., Jones, S.P.: Associated type synonyms. In: Pierce, B.C. (ed.) Proc. Intl. Conf. Functional Programming 2005, Tallinn, Estonia, September 2005, pp. 241–253. ACM Press, New York (2005)

    Google Scholar 

  9. Chakravarty, M.M.T., Keller, G., Jones, S.P., Marlow, S.: Associated types with class. In: Abadi, M. (ed.) Proc. 32nd ACM Symp. POPL, Long Beach, CA, January 2005, pp. 1–13. ACM Press, New York (2005)

    Google Scholar 

  10. Chambers, C.: Object-oriented multi-methods in Cecil. In: Madsen, O.L. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)

    Chapter  Google Scholar 

  11. Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM Trans. Prog. Lang. and Systems 28(3), 517–575 (2006)

    Article  Google Scholar 

  12. Ernst, E.: Family polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  13. Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: Jones, S.P. (ed.) Proc. 33rd ACM Symp. POPL, Charleston, South Carolina, January 2006, pp. 270–282. ACM Press, New York (2006)

    Google Scholar 

  14. Eugster, P.: Uniform proxies for Java. In: Proc. 21th ACM Conf. OOPSLA, Portland, OR, pp. 139–152. ACM Press, New York (2006)

    Google Scholar 

  15. Hall, C.V., Hammond, K., Jones, S.L.P., Wadler, P.L.: Type classes in Haskell. ACM Trans. Prog. Lang. and Systems 18(2), 109–138 (1996)

    Article  Google Scholar 

  16. Helm, R., Holland, I.M., Gangopadhyay, D.: Contracts: specifying behavioral compositions in object-oriented systems. In: Conf. OOPSLA / ECOOP, Ottawa, Canada, October 1990, vol. 25(10), pp. 169–180 (1990)

    Google Scholar 

  17. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Prog. Lang. and Systems 23(3), 396–450 (2001)

    Article  Google Scholar 

  18. Jones, M.P.: Type classes with functional dependencies. In: Smolka, G. (ed.) ESOP 2000 and ETAPS 2000. LNCS, vol. 1782, pp. 230–244. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  19. Järvi, J., Willcock, J., Lumsdaine, A.: Associated types and constraint propagation for mainstream object-oriented generics. In: Proc. 20th ACM Conf. OOPSLA, pp. 1–19. ACM Press, New York (2005)

    Google Scholar 

  20. Kaes, S.: Parametric overloading in polymorphic programming languages. In: Ganzinger, H. (ed.) ESOP 1988. LNCS, vol. 300, pp. 131–144. Springer, Heidelberg (1988)

    Google Scholar 

  21. Kennedy, A., Syme, D.: Design and implementation of generics for the .NET common language runtime. In: Proc. 2001 PLDI, Snowbird, UT, June 2001, pp. 1–12. ACM Press, New York (2001)

    Chapter  Google Scholar 

  22. 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–353. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  23. Lämmel, R., Ostermann, K.: Software extension and integration with type classes. In: GPCE ’06, pp. 161–170. ACM Press, New York (2006)

    Chapter  Google Scholar 

  24. Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the BETA Programming Language. Addison-Wesley, Reading (1993)

    Google Scholar 

  25. Microsoft Corp. C# Version 3.0 Specification (May 2006), http://msdn2.microsoft.com/en-us/vcsharp/aa336745.aspx

  26. Millstein, T., Reay, M., Chambers, C.: Relaxed MultiJava: Balancing extensibility and modular typechecking. In: Proc. 18th ACM Conf. OOPSLA, Anaheim, CA, pp. 224–240. ACM Press, New York (2003)

    Google Scholar 

  27. Odersky, M.: The scala language specification version 2.0, Draft (November 2006), http://scala.epfl.ch/docu/files/ScalaReference.pdf

  28. Odersky, M., Zenger, M.: Scalable component abstractions. In: Proc. 20th ACM Conf. OOPSLA, San Diego, CA, 2005, pp. 41–58. ACM Press, New York (2005)

    Google Scholar 

  29. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  30. Peyton Jones, S., Jones, M., Meijer, E.: Type classes: An exploration of the design space. In: Launchbury, J. (ed) Proc. of the Haskell Workshop, Amsterdam, June 1997, The Netherlands (1997)

    Google Scholar 

  31. Sekharaiah, K.C., Ram, D.J.: Object schizophrenia problem in object role system design. In: Bellahsène, Z., Patel, D., Rolland, C. (eds.) OOIS 2002. LNCS, vol. 2425, pp. 494–506. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  32. Siek, J., Lumsdaine, A.: Essential language support for generic programming. In: Proc. 2005 ACM Conf. PLDI, June 2005, pp. 73–84. ACM Press, New York (2005)

    Google Scholar 

  33. Torgersen, M.: The expression problem revisited — four new solutions using generics. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, Springer, Heidelberg (2004)

    Google Scholar 

  34. Torgersen, M., Ernst, E., Hansen, C.P.: Wild FJ. In: International Workshop on Foundations of Object-Oriented Languages, informal proceedings (2005)

    Google Scholar 

  35. Torgersen, M., Ernst, E., Hansen, C.P., von der Ahé, P., Bracha, G., Gafter, N.: Adding wildcards to the java programming language. Journal of Object Technology 3(11), 97–116 (2004)

    Google Scholar 

  36. Wadler, P.: The expression problem, Posted on Java Genericity mailing list (1998)

    Google Scholar 

  37. Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad-hoc. In: Proc. 16th ACM Symp. POPL, Austin, Texas, January 1989, pp. 60–76. ACM Press, New York (1989)

    Google Scholar 

  38. Warth, A., Stanojevic, M., Millstein, T.: Statically scoped object adaptation with expanders. In: Proc. 21th ACM Conf. OOPSLA, Portland, OR, 2006, pp. 37–56. ACM Press, New York (2006)

    Google Scholar 

  39. Yu, D., Kennedy, A., Syme, D.: Formalization of generics for the .NET common language runtime. In: Leroy, X. (ed.) Proc. 31st ACM Symp. POPL, Venice, Italy, January 2004, pp. 39–51. ACM Press, New York (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Erik Ernst

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Wehr, S., Lämmel, R., Thiemann, P. (2007). JavaGI: Generalized Interfaces for Java. In: Ernst, E. (eds) ECOOP 2007 – Object-Oriented Programming. ECOOP 2007. Lecture Notes in Computer Science, vol 4609. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73589-2_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-73589-2_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-73588-5

  • Online ISBN: 978-3-540-73589-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics