Marker Trait

  • John Hunt


The Marker Trait pattern uses traits that declare no methods, functions, types or properties to indicate additional semantics of a type (class, object or further traits). An alternative could be to use annotations, however annotations are not part of the type system of Scala, and thus can only provide additional semantic meaning where as a Marker trait also adds the ability to be treated as part of Scala the type system.

Copyright information

© Springer International Publishing Switzerland 2013

Authors and Affiliations

  • John Hunt
    • 1
  1. 1.Department of Computer Science and Creative TechnologiesUniversity of the West of EnglandBristolUK

Personalised recommendations