Skip to main content

Using C++ templates to implement role-based designs

  • Design and Evolution
  • Conference paper
  • First Online:

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

Abstract

Within the object-oriented technology community, much recent work on design reuse has focused on role-based collaborations distributed across multiple objects. Many benefits can be derived by mapping role-based designs directly into implementations, including greater ease in maintaining the connection between designs and implementations under change, and the opportunity for code reuse along with design reuse. Current efforts in role-based designs do not generally provide these benefits. We provide a method for mapping role-based designs into implementation, preserving the design without unnecessary constraints on the design structures. Roles are represented as parameterized classes, where the parameters represent the types of the participants in the collaboration. Composition of roles is implicit in the binding of parameters to classes in the implementation. The bindings are created at compile time by class definitions that are separate from the role implementations. In this paper we focus on the use of templates in the C++ language as the supporting mechanism.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. D. S. Batory and S. O'Malley. The design and implementation of hierarchical software systems with reusable components. ACM Transactions on Software Engineering and Methodology, 1(4):355–398, October 1992.

    Google Scholar 

  2. Don Batory, Vivek Singhal, Marty Sirkin, and Jeff Thomas. Scalable software libraries. In Proceedings of the First ACM SIGSOFT Symposium on Foundations of Software Engineering, pages 191–199, 1993.

    Google Scholar 

  3. Kent Beck and Ward Cunningham. A laboratory for teaching object-oriented thinking. In Proceedings of the 1989 ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pages 1–6, 1989.

    Google Scholar 

  4. Gilad Bracha. The programming language JIGSAW: Mixins, Modularity and Inheritance. PhD thesis, University of Utah, 1992.

    Google Scholar 

  5. Gilad Bracha and William Cooke. Mixin-based inheritance. In Proceedings of the 1990 ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pages 303–311, 1990.

    Google Scholar 

  6. Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1994.

    Google Scholar 

  7. William Harrison and Harold Ossher. Subject-oriented programming (a critique of pure objects). In Proceedings of the 1993 ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pages 411–428, 1993.

    Google Scholar 

  8. William Harrison, Harold Ossher, Randall B. Smith, and David Ungar. Subjectivity in object-oriented systems workshop summary. In Addendum to the Proceedings of the 1993 ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pages 131–136, 1994.

    Google Scholar 

  9. Richard Helm, Ian M. Holland, and Dipayan Gangopadhyay. Contracts: Specifying behavioral compositions in object-oriented systems. In Proceedings of the 1990 ACM Conference on Object-Oriented Programming Systems, Languages and Applications, pages 169–180, 1990.

    Google Scholar 

  10. Ian M. Holland. The Design and Representation of Object-Oriented Components. PhD thesis, Northeastern University, 1992.

    Google Scholar 

  11. Ian M. Holland. Specifying reusable components using contracts. In Proceedings of the 1992 European Conference on Object-Oriented Programming, pages 287–308, 1992.

    Google Scholar 

  12. Ralph Johnson and Brian Foote. Designing reusable classes. Journal of Object-Oriented Programming, 1(2):22–35, June/July 1988.

    Google Scholar 

  13. Karl J. Lieberherr and Arthur J. Riel. Demeter: A CASE study of software growth through parameterized classes. Journal of Object-Oriented Programming, 1(3):8–22, August/September 1988.

    Google Scholar 

  14. Karl J. Lieberherr and Cun Xiao. Minimizing dependency on class structures with adaptive programs. In Object Technologies for Advanced Software: Proceedings of the First JSSST International Symposium, pages 424–441, 1993.

    Google Scholar 

  15. Karl J. Lieberherr and Cun Xiao. Object-oriented software evolution. IEEE Transactions on Software Engineering, 19(4):313–343, April 1993.

    Google Scholar 

  16. D. R. Musser and A. A. Stepanov. Algorithm-oriented generic libraries. Software Practice and Experience, 24(7):623–642, July 1994.

    Google Scholar 

  17. Trygve Reenskaug and Egil P. Anderson. System design by composing structures of interacting objects. In Proceedings of the 1992 European Conference on Object-Oriented Programming, pages 133–152, 1992.

    Google Scholar 

  18. Trygve Reenskaug, Egil P. Anderson, Arne Jorgen Berre, Anne Hurlen, Anton Landmark, Odd Arild Lehne, Else Nordhagen, Erik Ness-Ulseth, Gro Oftedal, Anne Lise Skaar, and Pal Stenslet. OORASS: Seamless support for the creation and maintenance of object-oriented systems. Journal of Object-Oriented Programming, 5(6):27–41, October 1992.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Kokichi Futatsugi Satoshi Matsuoka

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

VanHilst, M., Notkin, D. (1996). Using C++ templates to implement role-based designs. In: Futatsugi, K., Matsuoka, S. (eds) Object Technologies for Advanced Software. ISOTAS 1996. Lecture Notes in Computer Science, vol 1049. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60954-7_41

Download citation

  • DOI: https://doi.org/10.1007/3-540-60954-7_41

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

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

  • Online ISBN: 978-3-540-49747-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics