Index
A
- abstract factory design pattern
- about / The abstract factory design pattern, The abstract factory
- class diagram / Class diagram
- code example / Code example
- Scala alternatives / Scala alternatives
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- abstraction
- about / Abstraction and vocabulary
- abstract types
- about / Abstract types, Abstract types
- versus generics / Generics versus abstract types
- usage advice / Usage advice
- ad-hoc polymorphism
- about / Ad hoc polymorphism
- functions, adding for multiple types / Adding functions for multiple types
- adapter design pattern
- about / The adapter design pattern, The adapter design pattern
- class diagram / Class diagram
- code example / Code example
- with final classes / The adapter design pattern with final classes
- with Scala / The adapter design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- advanced monad
- example / More advanced monad example
- Akka
- URL / Code example
- reference link / The libraries to use
- algebraic data types (ADTs)
- and class hierarchies / Algebraic data types and class hierarchies
- about / ADTs
- sum ADTs / Sum ADTs
- product ADTs / Product ADTs
- hybrid ADTs / Hybrid ADTs
- unification / The unification
- pattern matching / Pattern matching
- algebraic structure
- about / What are monoids?
- alternative lazy evaluation
- about / Alternative lazy evaluation
- AOP
- about / Aspect-oriented programming
- application
- writing / Writing a complete application
- specifications / Application specifications
- future / The future of our application
- application, implementing
- about / Implementation
- libraries, to use / The libraries to use
- code, writing / Writing some code
- wiring / Wiring it all up
- end result / The end result
- application testing
- about / Application testing
B
- balanced fold / Monoids and parallel computations
- behavioral design patterns
- about / Behavioral design patterns, What are behavioral design patterns?
- value object / The value object design pattern, The value object design pattern
- null object / The null object design pattern, The null object design pattern
- strategy / The strategy design pattern, The strategy design pattern
- command / The command design pattern, The command design pattern
- chain of responsibility / The chain of responsibility design pattern, The chain of responsibility design pattern
- interpreter / The interpreter design pattern, The interpreter design pattern
- iterator / The iterator design pattern, The iterator design pattern
- mediator / The mediator design pattern, The mediator design pattern
- memento / The memento design pattern, The memento design pattern
- observer / The observer design pattern, The observer design pattern
- state / The state design pattern, The state design pattern
- template method / The template method design pattern, The template method design pattern
- visitor / The visitor design pattern, The visitor design pattern
- bridge design pattern
- about / The bridge design pattern, The bridge design pattern
- class diagram / Class diagram
- code example / Code example
- with Scala / The bridge design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- builder design pattern
- about / The builder design pattern, The builder design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- by-name parameters
- by name parameters
- about / Lazy evaluation
- evaluating / Evaluating by name parameters only once
C
- cake design pattern / Composing with self types
- about / The cake design pattern, The cake design pattern, Dependency injection in Scala
- and self types / Self types and the cake design pattern
- alternatives / Other alternatives
- implicits, using / Implicits
- Reader monad / Reader monad
- case example
- about / Chapter case example, Without AOP
- with AOP / With AOP
- chain of responsibility design pattern
- about / The chain of responsibility design pattern, The chain of responsibility design pattern
- class diagram / Class diagram
- code example / Code example
- with Scala / The chain of responsibility design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- clashing scenarios, traits
- same signatures and return types traits / Same signatures and return types traits
- same signatures and different return types traits / Same signatures and different return types traits
- same signatures and return types mixins / Same signatures and return types mixins
- same signatures and different return types mixins / Same signatures and different return types mixins
- code example, builder design pattern
- about / Code example
- in Java / Java-like implementation
- with case class / Implementation with a case class
- generalized type constraints, using / Using generalized type constraints
- require statements, using / Using require statements
- command
- about / Class diagram
- command design pattern
- about / The command design pattern, The command design pattern
- class diagram / Class diagram
- command / Class diagram
- receiver / Class diagram
- invoker / Class diagram
- client / Class diagram
- code example / Code example
- with Scala / The command design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- complex traits
- composing / Composing complex traits
- components
- about / Components in Scala
- implementing / Implementing components
- composing
- about / Composing
- composite design pattern
- about / The composite design pattern, The composite design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- composition
- and monoids / Monoids and composition
- computation builders
- about / Using monads
- context bounds
- about / Type class example
- creational design patterns
- about / Creational design patterns, What are creational design patterns?
- abstract factory / The abstract factory design pattern, The abstract factory
- factory method / The factory method design pattern, The factory method design pattern
- lazy initialization / The lazy initialization design pattern, Lazy initialization
- singleton / The singleton design pattern, The singleton design pattern
- object pool / The object pool design pattern
- builder / The builder design pattern, The builder design pattern
- prototype design / The prototype design pattern
- prototype / The prototype design pattern
- curried functions
D
- data transfer objects (DTOs) / What is it good for?
- decorator design pattern
- about / The decorator design pattern, The decorator design pattern
- class diagram / Class diagram
- code example / Code example
- with Scala / The decorator design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- dependency injection
- dependency injection, in Scala
- about / Dependency injection in Scala
- code, writing / Writing our code, Wiring it all up
- application, unit testing / Unit testing our application
- dependency injection, with implicits
- dependency injection libraries
- dependency management
- about / Dependency management
- design patterns
- about / Design patterns
- formal definition / Design patterns
- need for / The need for design patterns and their benefits
- benefits / The need for design patterns and their benefits
- types / Design pattern categories
- creational design patterns / Creational design patterns
- structural design patterns / Structural design patterns
- behavioral design patterns / Behavioral design patterns
- functional design patterns / Functional design patterns
- Scala-specific design patterns / Scala-specific design patterns
- selecting / How to choose a design pattern
- development environment
- setting up / Setting up the development environment
- diamond problem / The diamond problem
- do not repeat yourself (DRY) / The type class design pattern
- duck typing
- about / Duck typing, Duck typing
- example / Duck typing example
- alternatives / Alternatives
- using / When to use duck typing
E
- elements
- popping, from stack / Code example
F
- facade design pattern
- about / The facade design pattern, The facade design pattern
- class diagram / Class diagram
- code examples / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- factory combinations
- about / Factory combinations
- factory design patterns
- about / Other factory design patterns
- static factory / The static factory
- simple factory / The simple factory
- factory combinations / Factory combinations
- factory method design pattern
- about / The factory method design pattern, The factory method design pattern
- class diagram / Class diagram
- code example / Code example
- Scala alternatives / Scala alternatives
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- flyweight design pattern
- about / The flyweight design pattern, The flyweight design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- foldable collections
- and monoids / Monoids and foldable collections
- functional design patterns
- about / Functional design patterns
- monoids / Monoids
- monads / Monads
- functors / Functors
- functions
- about / Functions and classes
- as classes / Functions as classes
- literals / Function literals
- without syntactic sugar / Functions without syntactic sugar
- increased expressivity / Increased expressivity
- functor laws
- functors
- about / Functors, Functors
- in real life / Functors in real life
- using / Using our functors
G
- generalized type constraints
- about / Using generalized type constraints
- Person class, modifying / Changing the Person class
- PersonBuilder class, modifying / Changing the PersonBuilder class
- adding, to required methods / Adding generalized type constraints to the required methods
- type-safe builder, using / Using the type-safe builder
- generics
- about / Generics
- versus abstract types / Generics versus abstract types
- usage advice / Usage advice
- Guice
H
- H2
- URL / Writing our code
- hybrid ADTs / Hybrid ADTs
- hybrid language
- about / Scala and design patterns
I
- immutable
- about / Immutable and verbose
- implicit classes
- reference link / What is it not so good for?
- implicit conversions
- about / Implicit conversions
- implicit dependency injection
- testing with / Testing with implicit dependency injection
- implicit injection
- about / Implicit injection, Implicit injection
- inheritance
- versus self types / Self types versus inheritance
- inheritance hierarchies
- rules / Rules of inheritance hierarchies
- inheritance leaks functionality / Inheritance leaks functionality
- interpreter design pattern
- about / The interpreter design pattern, The interpreter design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- invoker
- about / The command design pattern, Class diagram
- iterator design pattern
- about / The iterator design pattern, The iterator design pattern
- class diagram / Class diagram
- code example / Code example
- drawbacks / What is it not so good for?
J
- json4s
- reference link / Chapter case example, The libraries to use
- about / Chapter case example
L
- lazy evaluation
- about / Lazy evaluation, Lazy evaluation
- lazy initialization design pattern
- about / The lazy initialization design pattern, Lazy initialization
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- lazy variables
- about / Lazy evaluation
- lens design pattern
- about / The lens design pattern, The lens design pattern, With the lens design pattern
- example / Lens example
- boilerplate, minimizing / Minimizing the boilerplate
- libraries
- need for / Why should we use libraries?
- linearization
- about / The diamond problem, Linearization
- inheritance hierarchies rules / Rules of inheritance hierarchies
- rules / Linearization rules
- working / How linearization works
- instances, creating / Initialization
- method, overriding / Method overriding
M
- Maven
- about / Dependency management
- overview / Maven
- download link / Maven
- versus SBT / SBT versus Maven
- Maven, commands
- MD5 / Class diagram
- mediator design pattern
- about / The mediator design pattern, The mediator design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- memento design pattern
- about / The memento design pattern, The memento design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- memoization
- about / Memoization, Memoization
- example / Memoization example
- alternatives / Alternatives
- mixin
- about / Traits as interfaces
- compositions / Mixin compositions
- modules
- about / Modules and objects
- using / Using modules
- monad intuition / Monad intuition
- monad laws
- about / The monad laws
- identity law / The monad laws
- unit law / The monad laws
- composition / The monad laws
- zero identity / The monad laws
- reverse zero / The monad laws
- commutativity / The monad laws
- monad rules
- about / What is a monad?
- monads
- about / Monads, Monads, What is a monad?
- flatMap method / The flatMap method
- unit method / The unit method
- connection between map, flatMap, and unit / The connection between map, flatMap, and unit
- names of methods / The names of the methods
- in real life / Monads in real life
- using / Using monads
- monads, in Scalaz
- about / Monads in Scalaz
- using / Using monads
- testing / Testing monads
- Monocle
- monoid laws
- about / What are monoids?
- monoids
- about / Monoids, Monoids, What are monoids?
- in real life / Monoids in real life
- using / Using monoids, When to use monoids?
- and foldable collections / Monoids and foldable collections
- and parallel computations / Monoids and parallel computations
- and composition / Monoids and composition
- monoids, in Scalaz
- about / Monoids in Scalaz
- using / Using monoids
- testing / Testing monoids
- mpilquist/simulacrum
- reference link / Alternatives
- multiple inheritance
- about / Multiple inheritance
- diamond problem / The diamond problem
- limitations / The limitations
- mutable properties
- using / Using mutable properties
N
- nonterminal expression
- about / Class diagram
- null object design pattern
- about / The null object design pattern, The null object design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
O
- object pool design pattern
- about / The object pool design pattern
- objects
- about / Modules and objects
- observer design pattern
- about / The observer design pattern, The observer design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- option monad
- about / The option monad
P
- parallel computations
- and monoids / Monoids and parallel computations
- parametric polymorphism
- about / Parametric polymorphism
- partial functions
- partially defined functions
- about / Partially defined functions
- pattern matching
- about / Pattern matching
- values, using / Pattern matching with values
- for product ADTs / Pattern matching for product ADTs
- Pimp my library
- about / Pimp my library
- pimp my library design pattern
- about / The pimp my library design pattern
- using / Using the pimp my library
- in real life / Pimp my library in real life
- polymorphism
- about / Polymorphism
- subtype polymorphism / Subtype polymorphism
- parametric polymorphism / Parametric polymorphism
- ad-hoc polymorphism / Ad hoc polymorphism
- POM (Project Object Model) / Writing our code
- product ADTs
- about / Product ADTs
- pattern matching / Pattern matching for product ADTs
- prototype design pattern
- about / The prototype design pattern, The prototype design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- proxy design pattern
- about / The proxy design pattern, The proxy design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
R
- receiver
- about / Class diagram
S
- SBT
- about / Dependency management, SBT
- download link / SBT
- versus Maven / SBT versus Maven
- SBT, commands
- sbtassembly plugin
- reference link / SBT
- Scala
- about / Scala and design patterns
- design patterns / Scala and design patterns
- installing / Installing Scala
- download link / Installing Scala
- reference link, for installation tips / Installing Scala
- installing, tips / Installing Scala
- URL / Traits
- features / Scala is rich
- Scala-specific design patterns
- about / Scala-specific design patterns
- lens design pattern / The lens design pattern
- cake design pattern / The cake design pattern
- Pimp my library / Pimp my library
- stackable traits / Stackable traits
- type class design pattern / The type class design pattern
- lazy evaluation / Lazy evaluation
- partial functions / Partial functions
- implicit injection / Implicit injection
- duck typing / Duck typing
- memoization / Memoization
- ScalaCheck
- URL / Testing monoids
- Scala IDEs
- about / Scala IDEs
- Scala unified type system
- URL / Functions and classes
- Scalaz library
- about / The Scalaz library
- reference link / The Scalaz library
- monoids / Monoids in Scalaz
- monads / Monads in Scalaz
- possibilities / The possibilities of Scalaz
- self-type
- used, for composing / Composing with self types
- self type annotation / Writing our code
- self types
- about / Self types
- using / Using self types
- naming / Using self types
- multiple components, requiring / Requiring multiple components
- conflicting components / Conflicting components
- and cake design pattern / Self types and the cake design pattern
- versus inheritance / Self types versus inheritance
- for components / Self types for components
- SHA-1 / Class diagram
- SHA-256 / Class diagram
- simple factory
- about / The static factory, The simple factory
- simple traits
- composing / Composing simple traits
- singleton design pattern
- about / The singleton design pattern, The singleton design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- slf4j
- reference link / Without AOP
- about / Without AOP
- Spring
- stack
- elements, popping from / Code example
- stackable traits
- about / Stackable traits, The decorator design pattern the Scala way
- order of execution / Using stackable traits
- Stackable Traits / Extending traits
- stackable traits design pattern
- about / The stackable traits design pattern
- using / Using stackable traits
- state design pattern
- about / The state design pattern, The state design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- strategy design pattern
- about / The strategy design pattern, The strategy design pattern
- class diagram / Class diagram
- code example / Code example
- with Scala / The strategy design pattern the Scala way
- structural design patterns
- about / Structural design patterns, What are structural design patterns?
- adapter / The adapter design pattern, The adapter design pattern
- decorator / The decorator design pattern, The decorator design pattern
- bridge / The bridge design pattern, The bridge design pattern
- composite / The composite design pattern, The composite design pattern
- facade / The facade design pattern, The facade design pattern
- flyweight / The flyweight design pattern, The flyweight design pattern
- proxy / The proxy design pattern, The proxy design pattern
- subtype polymorphism
- about / Subtype polymorphism
- sum ADTs / Sum ADTs
T
- template method design pattern
- about / The template method design pattern, The template method design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- terminal expression
- about / Class diagram
- testing
- about / Testing
- tests
- running / Running the tests
- traits
- about / Traits
- parameters / Traits
- as interfaces / Traits as interfaces
- mixing, in with variables / Mixing in traits with variables
- as classes / Traits as classes
- classes, extending / Extending classes
- extending / Extending traits
- mixing / Mixing traits in, Mixing the trait in
- clashing / Clashing traits
- clashing, scenarios / Same signatures and return types traits, Same signatures and different return types traits, Same signatures and return types mixins, Same signatures and different return types mixins
- testing / Testing traits
- class, using / Using a class
- mixing, into test class / Mixing into the test class
- mixing, into test cases / Mixing into the test cases
- versus classes / Traits versus classes
- general guidelines / Traits versus classes
- type-safe builder
- type class design pattern
- about / The type class design pattern, The type class design pattern
- example / Type class example
- alternatives / Alternatives
- Typesafe config
- reference link / The libraries to use
U
- unit testing
- about / Unit testing
V
- value object design pattern
- about / The value object design pattern, The value object design pattern
- class diagram / Class diagram
- code example / Code example
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- verbose
- about / Immutable and verbose
- visitor design pattern
- about / The visitor design pattern, The visitor design pattern
- class diagram / Class diagram
- code example / Code example
- with Scala / The visitor design pattern the Scala way
- benefits / What is it good for?
- drawbacks / What is it not so good for?
- vocabulary
- about / Abstraction and vocabulary
Z
- zero value
- about / Monoids and foldable collections