Book Image

Building Applications with Scala

By : Diego Pacheco
Book Image

Building Applications with Scala

By: Diego Pacheco

Overview of this book

<p>Scala is known for incorporating both object-oriented and functional programming into a concise and extremely powerful package. However, creating an app in Scala can get a little tricky because of the complexity the language has. This book will help you dive straight into app development by creating a real, reactive, and functional application. We will provide you with practical examples and instructions using a hands-on approach that will give you a firm grounding in reactive functional principles.</p> <p>The book will take you through all the fundamentals of app development within Scala as you build an application piece by piece. We’ve made sure to incorporate everything you need from setting up to building reports and scaling architecture. This book also covers the most useful tools available in the Scala ecosystem, such as Slick, Play, and Akka, and a whole lot more. It will help you unlock the secrets of building your own up-to-date Scala application while maximizing performance and scalability.</p>
Table of Contents (17 chapters)
Building Applications with Scala
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface

Introducing the Slick framework


Scala Language Integrated Connection Kit (Slick) is a Scala modern framework, which allows working with data using abstractions that are very similar to Scala collections. You can write database queries in both SQL and Scala code. Writing Scala code instead of SQL is better, because we leverage the compiler, and hence, this approach is less error-prone. Also, it becomes easier to maintain the code, since the compiler will help you by pointing out where the code breaks, if it happens.

Slick is a Functional Relational Mapping (FRM) library. Those of you who come from a Java background, and are familiar with Object Relational Mapping (ORM) frameworks such as Hibernate, will see that Slick has similar concepts. Basically, you create a Scala class, which will explicitly map to a relational table. Slick FRM ideas are inspired by Microsoft's LINQ framework.

Slick is reactive by design, and works in an asynchronous non-blocking IO model. Using Slick you have the following...