Scala Design Patterns

Want to download or buy Scala Design Patterns?

Click to download from Amazon →

Learn how to write efficient, clean, and reusable code with Scala Key Features Unleash the power of Scala and apply it in the real world to build scalable and robust applications. Learn about using and implementing Creational, Structural, Behavioral, and Functional design patterns in Scala Learn how to build scalable and extendable applications efficiently Book Description Design patterns make developers’ lives easier by helping them write great software that is easy to maintain, runs efficiently, and is valuable to the company or people concerned. You’ll learn about the various features of Scala and will be able to apply well-known, industry-proven design patterns in your work. The book starts off by focusing on some of the most interesting and latest features of Scala while using practical real-world examples. We will be learning about IDE’s and Aspect Oriented Programming. We will be looking into different components in Scala. We will also cover the popular “Gang of Four” design patterns and show you how to incorporate functional patterns effectively. The book ends with a practical example that demonstrates how the presented material can be combined in real-life applications. You’ll learn the necessary concepts to build enterprise-grade applications. By the end of this book, you’ll have enough knowledge and understanding to quickly assess problems and come up with elegant solutions. What you will learn Immerse yourself in industry-standard design patterns—structural, creational, and behavioral—to create extraordinary applications See the power of traits and their application in Scala Implement abstract and self types and build clean design patterns Build complex entity relationships using structural design patterns Create applications faster by applying functional design patterns Who this book is for If you want to increase your understanding of Scala and apply design patterns to real-life application development, then this book is for you.Prior knowledge of Scala language is assumed/ expected.

Table of contents

Title Page
Copyright and Credits
Scala Design PatternsSecond Edition
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
The Design Patterns Out There and Setting Up Your Environment
Design patterns
Scala and design patterns
The need for design patterns and their benefits
Design pattern categories
Creational design patterns
The abstract factory design pattern
The factory method design pattern
The lazy initialization design pattern
The singleton design pattern
The object pool design pattern
The builder design pattern
The prototype design pattern
Structural design patterns
The adapter design pattern
The decorator design pattern
The bridge design pattern
The composite design pattern
The facade design pattern
The flyweight design pattern
The proxy design pattern
Behavioral design patterns
The value object design pattern
The null object design pattern
The strategy design pattern
The command design pattern
The chain of responsibility design pattern
The interpreter design pattern
The iterator design pattern
The mediator design pattern
The memento design pattern
The observer design pattern
The state design pattern
The template method design pattern
The visitor design pattern
Functional design patterns
Monoids
Monads
Functors
Scala-specific design patterns
The lens design pattern
The cake design pattern
Pimp my library
Stackable traits
The type class design pattern
Lazy evaluation
Partial functions
Implicit injection
Duck typing
Memoization
Choosing a design pattern
Setting up the development environment
Installing Scala
Tips for installing Scala manually
Tips for installing Scala using SBT
Scala IDEs
Dependency management
SBT
Maven
SBT versus Maven
Summary
Traits and Mixin Compositions
Traits
Traits as interfaces
Mixing in traits with variables
Traits as classes
Extending classes
Extending traits
Mixin compositions
Mixing traits in
Composing
Composing simple traits
Composing complex traits
Composing with self-types
Clashing traits
Same signatures and return types
Same signatures and different return types traits
Same signatures and return types mixins
Same signatures and different return types mixins
Multiple inheritance
The diamond problem
The limitations
Linearization
Rules of inheritance hierarchies
Linearization rules
How linearization works
Initialization
Method overriding
Testing traits
Using a class
Mixing the trait in
Mixing into the test class
Mixing into the test cases
Running the tests
Traits versus classes
Summary
Unification
Functions and classes
Functions as classes
Function literals
Functions without syntactic sugar
Increased expressivity
Algebraic data types and class hierarchies
ADTs
Sum ADTs
Product ADTs
Hybrid ADTs
The unification
Pattern matching
Pattern matching with values
Pattern matching for product ADTs
Modules and objects
Using modules
Summary
Abstract and Self Types
Abstract types
Generics
Abstract types
Generics versus abstract types
Usage advice
Polymorphism
Subtype polymorphism
Parametric polymorphism
Ad hoc polymorphism
Adding functions for multiple types
Self types
Using self types
Requiring multiple components
Conflicting components
Self types and the cake design pattern
Self types versus inheritance
Inheritance leaking functionality
Summary
Aspect-Oriented Programming and Components
Aspect-oriented programming
Understanding application efficiency
Timing our application without AOP
Timing our application with AOP
Components in Scala
Using Scala’s expressive power to build components
Implementing components
Self types for components
Summary
Creational Design Patterns
What are creational design patterns?
The factory method design pattern
An example class diagram
A code example
Scala alternatives
What it is good for?
What it is not so good for?
The abstract factory
An example class diagram
A code example
Scala alternatives
What it is good for?
What it is not so good for?
Other factory design patterns
The static factory
The simple factory
Factory combinations
Lazy initialization
An example class diagram
A code example
What it is good for?
What it is not so good for?
The singleton design pattern
An example class diagram
A code example
What it is good for?
What it is not so good for?
The builder design pattern
An example class diagram
A code example
A Java-like implementation
Implementation with a case class
Using generalized type constraints
Changing the Person class
Adding generalized type constraints to the required methods
Using the type-safe builder
Using require statements
What it is good for?
What it is not so good for?
The prototype design pattern
An example class diagram
A code example
What it is good for?
What it is not so good for?
Summary
Structural Design Patterns
Defining structural design patterns
The adapter design pattern
Example class diagram
Code example
The adapter design pattern with final classes
The adapter design pattern the Scala way
What it is good for
What it is not so good for
The decorator design pattern
Example class diagram
Code example
The decorator design pattern the Scala way
What it is good for
What it is not so good for
The bridge design pattern
Example class diagram
Code example
The bridge design pat
tern the Scala way
What it is good for
What it is not so good for
The composite design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The facade design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The flyweight design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The proxy design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
Summary
Behavioral Design Patterns – Part One
Defining behavioral design patterns
The value object design pattern
An example class diagram
A code example
Alternative implementation
What it is good for
What it is not so good for
The null object design pattern
An example class diagram
A code example
What it is good for
What it is not so good for
The strategy design pattern
An example class diagram
A code example
The strategy design pattern the Scala way
What it is good for
What it is not so good for
The command design pattern
An example class diagram
A code example
The command design pattern the Scala way
What it is good for
What it is not so good for
The chain of responsibility design pattern
An example class diagram
A code example
The chain of responsibility design pattern the Scala way
What it is good for
What it is not so good for
The interpreter design pattern
An example class diagram
A code example
What it is good for
What it is not so good for
Summary
Behavioral Design Patterns – Part Two
The iterator design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The mediator design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The memento design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The observer design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The state design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The template method design pattern
Example class diagram
Code example
What it is good for
What it is not so good for
The visitor design pattern
Example class diagram
Code example
The visitor design pattern the Scala way
What it is good for
What it is not so good for
Summary
Functional Design Patterns – the Deep Theory
Abstraction and vocabulary
Monoids
What are monoids?
Monoids in real life
Using monoids
Monoids and foldable collections
Monoids and parallel computations
Monoids and composition
When to use monoids
Functors
Functors in real life
Using our functors
Monads
What is a monad?
The flatMap method
The unit method
The connection between map, flatMap, and unit
The names of the methods
The monad laws
Monads in real life
Using monads
The Option monad
A more advanced monad example
Monad intuition
Summary
Applying What We Have Learned
The lens design pattern
Lens example
Without the lens design pattern
Immutable and verbose
Using mutable properties
With the lens design pattern
Minimizing the boilerplate
The cake design pattern
Dependency injection
Dependency injection libraries and Scala
Dependency injection in Scala
Writing our code
Wiring it all up
Unit testing our application
Other dependency injection alternatives
Implicits for dependency injection
Reader monad for dependency injection
The pimp my library design pattern
Using pimp my library
Pimp my library in real life
The stackable traits design pattern
Using stackable traits
The type class design pattern
Type class example
Type class design pattern alternatives
Lazy evaluation
Evaluating by-name parameters only once
Alternative lazy evaluation
Partial functions
Partial functions are not partially applied functions
Partially defined functions
Implicit injection
Implicit conversions
Dependency injection using implicits
Testing with implicit dependency injection
Duck typing
Duck typing example
Duck typing alternatives
When to use duck typing
Memoization
Memoization example
Memoization alternatives
Summary
Real-Life Applications
Reasons to use libraries
The Scalaz library
Monoids in Scalaz
Using monoids
Testing monoids
Monads in Scalaz
Using monads
Testing monads
The possibilities of Scalaz
Writing a complete application
Application specifications
Implementation
The libraries to use
Reading the application configuration
Reading the scheduler configuration
Scheduling tasks
Accessing a database
Executing console commands
Writing some code
Wiring it all up
The end result
Testing our application
Unit testing
Application testing
The future of our application
Summary
Other Books You May Enjoy
Leave a review – let other readers know what you think


Is Scala Design Patterns Free to Download?

No, i'm afraid not. Every single book that we feature on Allbooks.co is a paid-for, premium publication that you have to part your hard earned cash for. There is no point trying to find a free download of Scala Design Patterns so please don't waste your time looking. Head over to Amazon to buy a physical or digital copy of Scala Design Patterns. You can also buy a subscription from Perlego and gain access to over 500k textbooks and educational resources.

It is highly unlikely that you'll be able to find Scala Design Patterns for free. There's a lot of websites that will say "Free Download" but these are just attempts to get you to click on a link which will either take you to an ad landing page or you risk getting viruses on your computer. In the rare occasion that you do find a free download for Scala Design Patterns remember that it's illegal to download a book if you didn't pay for it!

If you really want Scala Design Patterns and you want to truly own it the legal and safe way, then click here to visit the download and purchase page on Amazon.com. The author and publisher deserves to be paid for their work, as they have put in the hours and the creativity to produce such an amazing publication / book.