Scala design patterns : write efficient, clean, and reusable code with Scala /
Write efficient, clean, and reusable code with Scala About This Book Unleash the power of Scala and apply it in the real world Increase your efficiency by leveraging the power of Creational, Structural, Behavioural, and Functional design patterns Build object oriented and functional applications qui...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Publishing,
2016.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; Chapter 1: 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 patternsThe 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 patternThe 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; How to choose a design pattern; Setting up the development environment; Installing Scala; Scala IDEs; Dependency management; SBT; Maven; SBT versus Maven; Summary; Chapter 2: Traits and Mixin Compositions; Traits; Traits as interfaces
- Mixing in traits with variablesTraits 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 traits; 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 overridingTesting 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; Chapter 3: 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; Chapter 4: Abstract and Self Types