Skip to main content

The Managed Adapter Pattern: Facilitating Glue Code Generation for Component Reuse

  • Conference paper

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

Abstract

The adapter or wrapper pattern is one of the most widely used patterns in software engineering since the problem of reconciling unsuitable component interfaces is so ubiquitous. However, the classic adapter pattern as described by the Gang of Four has some limitations which rule out its use in certain situations. Of the two forms of the pattern, only the object adapter form is usable with common programming languages not supporting multiple inheritance (such as Java or C#), and this is not able to adapt interfaces of classes whose own type is used in one or more of their operations. This makes it impossible for a tool to automatically generate “glue code” for such components and forces developers to come up with some non-trivial (and typically invasive) workarounds to enable clients to use them. In this paper we present an enhanced form of the adapter pattern which solves this problem by extending the way in which an adapter stores and manages adaptees. We therefore call it the Managed Adapter Pattern. After describing the pattern in the usual Gang of Four-oriented way, we describe its application in the system that initially motivated its development – a test-driven component search engine which is able to retrieve reusable assets based on their semantics. A key challenge in the implementation of this engine was developing a flexible glue code generator that was able to automate the creation of adapters for all the kinds of components delivered by the underlying component repository.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Szyperski, C.: Component Software, 2nd edn. Addison-Wesley, Amsterdam (2002)

    MATH  Google Scholar 

  2. Mili, A., Mili, R., Mittermeir, R.: A Survey of Software Reuse Libraries. Annals of Software Engineering 5 (1998)

    Google Scholar 

  3. Frakes, W.B., Pole, T.P.: An Empirical Study of Representation Methods for Reusable Software Components. IEEE Transactions on Software Engineering 20(8) (1994)

    Google Scholar 

  4. Hummel, O., Janjic, W., Atkinson, C.: Code Conjurer: Pulling Reusable Software out of Thin Air. IEEE Software 25(5) (2008)

    Google Scholar 

  5. Hummel, O., Atkinson, C.: Using the Web as a Reuse Repository. In: Morisio, M. (ed.) ICSR 2006. LNCS, vol. 4039, pp. 298–311. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  6. Inoue, K., Yokomori, R., Fujiwara, H., Yamamoto, T., Matsushita, M., Kusumoto, S.: Ranking Significance of Software Components Based on Use Relations. IEEE Transactions on Software Eng. 31(3) (2005)

    Google Scholar 

  7. Hummel, O., Atkinson, C.: Extreme Harvesting: Test Driven Discovery and Reuse of Software Components. In: International Conference on Information Reuse and Integration. IEEE Press, New York (2004)

    Google Scholar 

  8. Beck, K.: Test-Driven Development by Example. Addison-Wesley, Amsterdam (2003)

    Google Scholar 

  9. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. In: Elements of Reusable Object-Oriented Software. Addison-Wesley, Amsterdam (1995)

    Google Scholar 

  10. Mugridge, R., Cunningham, W.: FIT for Developing Software: Framework for Integrated Tests. Prentice Hall, Upper Saddle River (2005)

    Google Scholar 

  11. Atkinson, C., Bayer, J., Bunse, C., Kamsties, E., Laitenberger, O., Laqua, R., Muthig, D., Paech, B., Wust, J., Zettel, J.: Component-based Product Line Engineering with UML. Addison Wesley, Amsterdam (2002)

    Book  Google Scholar 

  12. Zaremski, A.M., Wing, J.M.: Signature Matching: A Tool for Using Software Libraries. ACM Transactions on Software Engineering and Methodology 4(2) (1995)

    Google Scholar 

  13. 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 

  14. Seiter, L., Mezini, M., Lieberherr, K.: Dynamic Component Gluing. In: Czarnecki, K., Eisenecker, U.W. (eds.) GCSE 1999. LNCS, vol. 1799, p. 134. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  15. Gschwind, T.: Type Based Adaptation: An Adaptation Approach for Dynamic Distributed Systems. In: van der Hoek, A., Coen-Porisini, A. (eds.) SEM 2002. LNCS, vol. 2596. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  16. Freeman, E., Freeman, E., Bates, B., Sierra, K.: Head First Design Patterns. O’Reilly, Sebastopol (2004)

    Google Scholar 

  17. Atkinson, C., Hummel, O.: Reconciling Reuse and Trustworthiness through Self-Adapting Components. In: International Workshop on Component-Oriented Programming, WCOP (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hummel, O., Atkinson, C. (2009). The Managed Adapter Pattern: Facilitating Glue Code Generation for Component Reuse. In: Edwards, S.H., Kulczycki, G. (eds) Formal Foundations of Reuse and Domain Engineering. ICSR 2009. Lecture Notes in Computer Science, vol 5791. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04211-9_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-04211-9_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-04210-2

  • Online ISBN: 978-3-642-04211-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics