/scala-design-patterns-v2

This repository contains design patterns implemented in the Scala programming language for the Scala Design Patterns - Second Edition book

Primary LanguageScala

scala-design-patterns-v2

This repository contains design patterns implemented in the Scala programming language for the Scala Design Patterns - Second Edition book. The code examples in the second edition of this book were written using both Maven and SBT as build tools.

Project Structure

The source code is available in both Maven and SBT under the following sub-folders:

The examples are identical in both Maven and SBT as one would expect. The only difference is the build tool, which is up to your personal preference.

Note: The unit tests in the Maven project are slightly different, because every class is annotated with @RunWith(classOf[JUnitRunner]). The reason for this is that junit is used to execute the tests with Maven.

There is a separate module for each topic/chapter covered in the book:

  1. Chapter 1: The Design Patterns Out There and Setting Up Your Environment
    • There is no code for this chapter. It provides the readers with some useful skeletons.
  2. Chapter 2: Traits and Mixin Compositions
  3. Chapter 3: Unification
  4. Chapter 4: Abstract and Self Types
  5. Chapter 5: Aspect-Oriented Programming and Components
    • mvn module name aop
  6. Chapter 6: Creational Design Patterns
  7. Chapter 7: Structural Design Patterns
  8. Chapter 8: Behavioral Design Patterns - Part One
  9. Chapter 9: Behavioral Design Patterns - Part Two
  10. Chapter 10: Functional Design Patterns - the Deep Theory
  11. Chapter 11: Applying What We Have Learned
  12. Chapter 12: Real-Life Applications

Running the Code

Clone this repository. You can run the code using an IDE such as IntelliJ or you can use Maven or SBT in the command line to build the jars with the examples.

Compiling the Projects

Running the Unit Tests

Creating the Jars

The package command will build jars inside the target folder of each submodule.