10.1145/1289971.1289984acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedings
Article

Library composition and adaptation using c++ concepts

ABSTRACT

Large scale software is composed of libraries produced by different entities. Non-intrusive and efficient mechanisms for adapting data structures from one library to conform to APIs of another are essential for the success of large software projects. Concepts and concept maps, planned features for the next version of C++, have been designed to support adaptation, promising generic, non-intrusive, efficient, and identity preserving adapters. This paper analyses the use of concept maps for library composition and adaptation, comparing and contrasting concept maps to other common adaptation mechanisms. We report on two cases of data structure adaptation between different libraries, indicating best practices and idioms along the way. First, we adapt GUI controls from several frameworks for use with a generic layout engine, extending the application of concepts to run-time polymorphism. Second, we develop a transparent adaptation layer between an image processing library and a graph algorithm library, enabling the efficient application of graph algorithms to the image processing domain.

References

  1. (GCC) 4.3.0 20070330 (experimental) (Indiana University Concept GCC alpha7 prerelease).Google ScholarGoogle Scholar
  2. Boost Smart Pointers Library. www.boost.org/libs/smart_ptr.Google ScholarGoogle Scholar
  3. Adobe Systems, Inc. Adobe Source Library, 2005. opensource.adobe.com.Google ScholarGoogle Scholar
  4. P. An, A. Jula, S. Rus, S. Saunders, T. Smith, G. Tanase, N. Thomas, N. Amato, and L. Rauchwerger. STAPL: An adaptive, generic parallel C++ library. In Languages and Compilers for Parallel Computing, volume 2624 of Lecture Notes in Computer Science, pages 193--208. Springer, Aug. 2001.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. H. Austern. Generic programming and the STL: Using and extending the C++ Standard Template Library. Professional Computing Series. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Baumgartner, M. Jansche, and K. Läufer. Half & Half: Multiple Dispatch and Retroactive Abstraction for Java. Technical Report OSU-CISRC-5/01-TR08, Ohio State University, 2002.Google ScholarGoogle Scholar
  7. E. P. Becker. Working draft, standard for programming language C++. Technical Report N2009=06-0079, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++, Apr. 2006.Google ScholarGoogle Scholar
  8. Boost. Boost C++ Libraries. http://www.boost.org/.Google ScholarGoogle Scholar
  9. L. Bourdev and H. Jin. Generic Image Library, 2006. opensource.adobe.com/gil.Google ScholarGoogle Scholar
  10. A. Breuer, P. Gottschling, D. Gregor, and A. Lumsdaine. Effecting parallel graph eigensolvers through library composition. In Performance Optimization for High-Level Languages and Libraries (POHLL), Apr. 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. M. T. Chakravarty, G. Keller, and S. Peyton Jones. Associated type synonyms. In ICFP '05: Proceedings of the International Conference on Functional Programming, pages 241--253, New York, NY, USA, Sept. 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. M. T. Chakravarty, G. Keller, S. Peyton Jones, and S. Marlow. Associated types with class. In POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 1--13, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Fabri, G.-J. Giezeman, L. Kettner, S. Schirra, and S. Schönherr. On the design of CGAL, a computational geometry algorithms library. Software - Practice and Experience, 30(11):1167--1202, 2000. Special Issue on Discrete Algorithm Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Publishing Co., New York, NY, USA, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Garcia, J. Järvi, A. Lumsdaine, J. Siek, and J. Willcock. An extended comparative study of language support for generic programming. Journal of Functional Programming, 17:145--205, Mar. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. D. Gregor. ConceptGCC: Concept extensions for C++. http://www.generic-programming.org/software/ConceptGCC, 2005.Google ScholarGoogle Scholar
  17. D. Gregor, J. Järvi, J. Siek, B. Stroustrup, G. D. Reis, and A. Lumsdaine. Concepts: Linguistic support for generic programming in C++. In Proceedings of the 2006 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA '06), pages 291--310. ACM Press, Oct. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Gregor and A. Lumsdaine. Lifting sequential graph algorithms for distributed-memory parallel computation. In Proceedings of the 2005 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA '05), pages 423--437, Oct. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. D. Gregor and B. Stroustrup. Proposed wording for concepts. Technical Report N2193=07-0053, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++, Mar. 2007.Google ScholarGoogle Scholar
  20. IBM Research. Subject-oriented programming and the adapter pattern. www.research.ibm.com/sop/sopcadap.htm.Google ScholarGoogle Scholar
  21. International Organization for Standardization. ISO/IEC 14882:2003: Programming languages: C++. Geneva, Switzerland, 2nd edition, Oct. 2003.Google ScholarGoogle Scholar
  22. J. Järvi, J. Willcock, and A. Lumsdaine. Concept-controlled polymorphism. In F. Pfennig and Y. Smaragdakis, editors, Generative Programming and Component Engineering, volume 2830 of LNCS, pages 228--244. Springer Verlag, Sept. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. M. Jazayeri, R. Loos, D. Musser, and A. Stepanov. Generic Programming. In Report of the Dagstuhl Seminar on Generic Programming, Schloss Dagstuhl, Germany, Apr. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. P. Jones. Type classes with functional dependencies. In ESOP '00: Proceedings of the 9th European Symposium on Programming Languages and Systems, volume 1782 of Lecture Notes in Computer Science, pages 230--244, New York, NY, 2000. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of AspectJ. In J. L. Knudsen, editor, ECOOP 2001 - Object-Oriented Programming 15th European Conference, volume 2072 of Lecture Notes in Computer Science, pages 327--353. Springer-Verlag, New York, NY, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. R. Lämmel and K. Ostermann. Software extension and integration with type classes. In GPCE '06: Proceedings of the 5th international conference on Generative programming and component engineering, pages 161--170, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. Läufer, G. Baumgartner, and V. F. Russo. Safe structural conformance for Java. The Computer Journal, 43(6):469--481, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  28. V. Litvinov. Constraint-based polymorphism in Cecil: towards a practical and static type system. In OOPSLA '98: Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 388--411, New York, NY, USA, 1998. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. B. Magnusson. Code reuse considered harmful Journal of Object-Oriented Programming, 4(3), Nov. 1991.Google ScholarGoogle Scholar
  30. M. Marcus, J. Järvi, and S. Parent. Runtime polymorphic generic programming - mixing objects and concepts in ConceptC++. In K. Davis and J. Striegnitz, editors, Multiparadigm Programming 2007: Proceedings of the MPOOL Workshop at ECOOP'07, July 2007. To appear.Google ScholarGoogle Scholar
  31. M. Mattsson, J. Bosch, and M. E. Fayad. Framework integration problems, causes, solutions. Commun. ACM, 42(10):80--87, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. B. McNamara and Y. Smaragdakis. Static interfaces in C++. In First Workshop on C++ Template Programming, Erfurt, Germany, Oct. 2000.Google ScholarGoogle Scholar
  33. K. Mehlhorn and S. Näher. The LEDA Platform of Combinatorial and Geometric Computing. Cambridge University Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. N. Mitchell, G. Sevitsky, and H. Srinivasan. The diary of a datum: An approach to modeling runtime complexity in framework-based applications. In Proceedings of the First International Workshop of Library-Centric Software Design (LCSD '05). An OOPSLA '05 workshop, Oct. 2005. As technical report 06-12 of Rensselaer Polytechnic Institute, Computer Science Department.Google ScholarGoogle Scholar
  35. N. C. Myers. Traits: a new and useful template technique. C++ Report, June 1995.Google ScholarGoogle Scholar
  36. M. Odersky. Poor man's type classes. Presentation at the meeting of IFIP WG 2.8, Functional Programming, July 2006. http://lamp.epfl.ch/~odersky/talks/wg2.8-boston06.pdf.Google ScholarGoogle Scholar
  37. M. Odersky. The Scala language specification: Version 2.0, draft march 17, 2006. http://scala.epfl.ch/docu/files/ScalaReference.pdf, 2006.Google ScholarGoogle Scholar
  38. S. Parent. Beyond objects: Understanding the software we write. Presentation at C++ Connections, opensource.adobe.com/wiki/index.php/Image:Regular_object_presentation.pdf, Nov. 2005.Google ScholarGoogle Scholar
  39. S. Parent. A possible future for software development. Keynote talk at the Workshop of Library-Centric Software Design 2006, at OOPSLA'06, Portland, Oregon, 2006. lcsd.cs.tamu.edu/2006.Google ScholarGoogle Scholar
  40. W. R. Pitt, M. A. Williams, M. Steven, B. Sweeney, A. J. Bleasby, and D. S. Moss. The Bioinformatics Template Library-generic components for biocomputing. Bioinformatics, 17(8):729--737, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  41. J. Siek, L.-Q. Lee, and A. Lumsdaine. The Boost Graph Library: User Guide and Reference Manual. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. J. Siek and A. Lumsdaine. The Matrix Template Library: Generic components for high-performance scientific computing. Computing in Science and Engineering, 1(6):70--78, Nov/Dec 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J. Siek and A. Lumsdaine. Concept checking: Binding parametric polymorphism in C++. In First Workshop on C++ Template Programming, Oct. 2000.Google ScholarGoogle Scholar
  44. J. Siek, A. Lumsdaine, and L.-Q. Lee. Boost Graph Library. Boost, 2001. www.boost.org/libs/graph.Google ScholarGoogle Scholar
  45. Silicon Graphics, Inc. SGI Implementation of the Standard Template Library, 2004. http://www.sgi.com/tech/stl/.Google ScholarGoogle Scholar
  46. A. Stepanov and M. Lee. The Standard Template Library. Technical Report HPL-94-34(R.1), Hewlett-Packard Laboratories, Apr. 1994. http://www.hpl.hp.com/techreports.Google ScholarGoogle Scholar
  47. C. Szyperski. Component software: beyond object-oriented programming. ACM Press/Addison-Wesley Publishing Co., New York, NY, USA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. M. Troyer and P. Dayal. The Iterative Eigensolver Template Library. http://www.comp-phys.org:16080/software/ietl/.Google ScholarGoogle Scholar
  49. P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In ACM Symposium on Principles of Programming Languages, pages 60--76. ACM, Jan. 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Library composition and adaptation using c++ concepts

      Comments

      Login options

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

      Sign in

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!