Skip to main content
  • 3602 Accesses

Abstract

This chapter looks at some of the more advanced features associated with the use of traits. The chapter looks at the way in which Traits can be dynamically wrapped around an instance providing a form of Aspect Oriented Programming (AOP) known as stackable traits. We then look at the role Traits can play in developing reusable behaviour that simplifies the development of new types. Universal traits used with Value Types are then discussed. The chapter concludes by considering the way in which traits can be used to define a restricted set of values for a given type.

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

Access this chapter

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to John Hunt .

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Hunt, J. (2014). Further Traits. In: A Beginner's Guide to Scala, Object Orientation and Functional Programming. Springer, Cham. https://doi.org/10.1007/978-3-319-06776-6_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-06776-6_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-06775-9

  • Online ISBN: 978-3-319-06776-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics