O'Reilly logo

Pragmatic Scala by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrapping Up

In this chapter, we explored an interesting and powerful Scala feature that promotes extensibility. Traits are a great design tool to create extensible code with dynamic behavior beyond what’s provided by one single class. They nicely avoid method collisions when multiple implementations are brought together. You saw how powerful patterns like the Decorator pattern can be elegantly implemented with traits.

In the next chapter, we’ll take a look at Scala’s support for collections of objects.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required