Skip to main content

Self Reflection for Adaptive Programming

  • Conference paper
  • First Online:
Generative Programming and Component Engineering (GPCE 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2487))

Abstract

Applications in an evolving computing environment should be designed to cope with varying data. Object-oriented programming, polymorphisms and parametric types often do not provide the required flexibility, which can be achieved with the use of metadata attached or extracted from objects by means of reflection. We present a general mechanism to support reflection in C++, exploiting template metaprogramming techniques. Metaclass objects are present at runtime and can be inspected to access information about objects, in particular about their fields. Metaobjects describing fields can be extended, through a mechanism similar to custom attributes in C#. The mechanism is self-reflective, allowing for metaclass objects to be described in turn. This allows storing and retrieving metaclasses from external storage and allows programs to understand and manipulate objects built by other programs. We present two case studies of the technique: building configuration objects and creating object-oriented interfaces to relational database tables.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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. Attardi, G., Cisternino, A.: Reflection support by means of template metaprogramming. Proceedings of Third International Conference on Generative and Component-Based Software Engineering, Lecture Notes in Computer Science, Vol. 2186. Springer-Verlag, Berlin (2001) 178–187

    Chapter  Google Scholar 

  2. Attardi, G.: Metaobject Programming in CLOS. In Object-Oriented Programming-The CLOS Perspective, A. Paepke (ed.), Cambridge, MA (1993)

    Google Scholar 

  3. W3C: Web Services Description Language. http://www.w3.org/TR/wsdl.

  4. Gabriel, R.G., Bobrow, D.G., White, J.L.: CLOS in ContextThe Shape of the Design Space. In Object Oriented Programming-The CLOS perspective. The MIT Press, Cambridge, MA (1993) 29–61

    Google Scholar 

  5. Czarnecki, K., Eisenacker, U.W.: Generative Programming-Methods, Tools, and Applications. Addison Wesley, Reading, MA (2000)

    Google Scholar 

  6. Stroustrup, B.: The Design and Evolution of C++. Addison Wesley, Reading, MA (1994)

    Google Scholar 

  7. Sleepycat Software, The Berkeley Database, http://www.sleepycat.com.

  8. MySQL, MySQL, http://www.mysql.com.

  9. Microsoft, ActiveX Data Objects, http://msdn.microsoft.com/library/psdk/dasdk/adot9elu.htm.

  10. K.A. Knizhnik, The GigaBASE Object-Relational database system, http://www.ispras.ru/~knizhnik.

  11. Sun Microsystems, Java Database Connectivity, http://java.sun.com/.

  12. Petter Urkedal, Tools for Template Metaprogramming, http://matfys.lth.se/~petter/src/more/metad .

  13. R. Sunderraman, Oracle8â„¢ Programming: a primer, Addison-Wesley, MA, (2000)

    Google Scholar 

  14. Plauger, P. J., Stepanov, A., Lee, M., Musser, D.: The Standard Template Library. Prentice-Hall (2000)

    Google Scholar 

  15. Malenfant, J., Jaques, M., Demers, F.N.: A tutorial on behavioral reflection and its implementation. Proceedings of the Reflection 96 Conference, Kiczales, G. (ed.), San Francisco, California, USA, April (1996) 1–20

    Google Scholar 

  16. Chuang, T.R, Kuo, Y. S., Wang, C.M.: Non-Intrusive Object Introspection in C++: Architecture and Application. Proceedings of the 20th Int. Conference on Software Engineering, IEEE Computer Society Press (1998) 312–321

    Google Scholar 

  17. Madany, P.W., Islam, N., Kougiouris, P., Campbell, R.H.: Reification and reflection in C++: An operating systems perspective. Technical Report UIUCDCS-R-92-1736, Dept. of Computer Science, University of Illinois at Urbana-Champaign, March (1992)

    Google Scholar 

  18. Ishikawa, Y., Hori, A., Sato, M., Matsuda, M., Nolte, J., Tezuka, H., Konaka, H., Maeda, M., Kubota, K.: Design and Implementation of metalevel architecture in C++-MPC++ approach. Proceedings of the Reflection 96 Conference, Kiczales, G. (ed.), San Francisco, California, USA, April (1996) 153–166

    Google Scholar 

  19. Gowing, B., Cahill, V.: Meta-Object Protocols for C++: The Iguana Approach. Proc. Reflection’ 96, San Francisco, California (1996) 137–152

    Google Scholar 

  20. Chiba, S.: A metaobject protocol for C++. Conference Proceedings of Object-Oriented Programming Systems, Languages and Applications, ACM Press (1995) 285–299

    Google Scholar 

  21. Raymond, E.S.: Why Python? Linux Journal, May (2001) http://www.linuxjournal.com/article.php?sid=3882.

  22. Ellis, M. A., Stroustrup, B.: The Annotated C++ Reference Manual. Addison-Wesley, MA (1990)

    Google Scholar 

  23. Jones, N.D., Gomard, C.K., Sestoft. P.: Partial Evaluation and Automatic Program Generation. Prentice Hall International, International Series in Computer Science, June (1993)

    Google Scholar 

  24. Maor, R., Brand, M.: XParam-General-Purpose Object Serialization Framework for C++. http://xparam.sourceforge.net .

  25. Grosso, W.: Java RMI Serialization. O’Reilly & Associates (2001) http://www.onjava.com/pub/a/onjava/excerpt/JavaRMI10 .

  26. Haible, B.: VACALL Manual. http://www.mit.edu/afs/sipb/project/clisp/new/clisp-1999-01-08/ffcall/avcall/avcall.html .

  27. Archer, T.: Inside C#. Microsoft Press, Redmond, WA (2001)

    Google Scholar 

  28. Mätzel, K.U., Bischofberger, W.: The Any Framework A Pragmatic Approach to Flexibility. Second Usenix Conference on Object-Oriented Technology and Systems, Toronto, June (1996)

    Google Scholar 

  29. Knizhnik, K.A.: The GigaBASE Object-Relational database system. http://www.ispras.ru/~knizhnik

  30. Sleepycat Software, The Berkeley Database, http://www.sleepycat.com.

  31. MySQL, MySQL, http://www.mysql.com.

  32. Microsoft, ActiveX Data Objects, http://msdn.microsoft.com/library/psdk/dasdk/adot9elu.htm.

  33. Sun Microsystems, Java Database Connectivity, http://java.sun.com.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Attardi, G., Cisternino, A. (2002). Self Reflection for Adaptive Programming. In: Batory, D., Consel, C., Taha, W. (eds) Generative Programming and Component Engineering. GPCE 2002. Lecture Notes in Computer Science, vol 2487. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45821-2_3

Download citation

  • DOI: https://doi.org/10.1007/3-540-45821-2_3

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-44284-4

  • Online ISBN: 978-3-540-45821-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics