Chapter 5. Aspect-Oriented Programming and Components

Many times in programming, we see pieces of source code that are repeated in different methods. In some cases, we could refactor our code and move them to separate modules. Sometimes, however, this is not possible. Some notable examples include logging and verification. Aspect-oriented programming is helpful in such cases, and we will get an understanding of it by the end of this chapter.

Components are reusable pieces of code that provide a number of services and have some requirements. They are extremely useful for avoiding code duplication and of course, for promoting code reuse. Here, we will see how to build components and how Scala makes the writing and use of components easier than other ...

Get Scala Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.