Leanpub Header

Skip to main content

Come out and Play

Webanwendungen schreiben mit Scala, Scala.js, Akka und dem Play Framework.

In diesem Buch liefern wir einen praxisorientierten Einstieg in die Entwicklung größerer Webanwendungen auf Basis moderner Technologien wie Scala, Akka,  dem Play Framework  und Scala.js.

Im Verlauf des Buches wird eine nicht-triviale Anwendung entwickelt wobei fortgeschrittene Techniken zum Einsatz kommen.

The authors are letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
45
Readers
372
Pages
About

About

About the Book

Mit diesem Buch erfolgt ein praxisorientierter Einstieg in die Entwicklung größerer Webanwendungen mit dem Play Framwork, Scala, Akka und Scala.js.

Es wird vermittelt, wie man Webanwendungen mit dem Play Framework schreibt, Datenbankzugriffe via Slick implementiert, Aufgaben asynchron mit Futures und Aktoren umsetzt sowie geteilten und clientseitigen Code via Scala.js generiert. Für Authorisierung und Authentifizierung wird das Silhoutte Framework genutzt. Websockets, die aus den meisten Anwendungen nicht mehr wegzudenken sind, kommen ebenfalls zum Einsatz.

Das Buch vermittelt, wie man SBT zur Verwaltung und Organisation von Projekten nutzt. Kenntnisse von Scala werden nicht vorausgesetzt, es erfolgt eine kurze Einführung in die Programmiersprache und die funktionale Programmierung mit Scala.

Für wen ist dieses Buch geeignet?

Das Buch richtet sich an alle, die sich für die Webentwicklung mit Scala und Play interessieren. Es sollte grundlegende Erfahrung in einer beliebigen Programmiersprache sowie Kenntnis von Webtechnologien vorhanden sein.

Welche Versionen werden genutzt?

Der Quelltext nutzt Scala 2.12, Play 2.6, Silhouette 5.0, Scala.js 0.6 sowie Cats 1.x. Ansonsten wird soweit möglich die jeweils aktuellste Version verwendeter Bibiliotheken genutzt.

Wo liegt der Code?

Das Repository mit dem Code zum Buch liegt in einem öffentlichen Repository bei GitLab: https://gitlab.com/comeoutandplay/code

Sonstiges

Wir haben ein Diskussionsforum zum Buch, das direkt bei Leanpub liegt: https://community.leanpub.com/c/comeoutandplay

Price

Pick Your Price...

Minimum price

$39.99

$49.99

You pay

$49.99

Authors earn

$39.99
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 3)

3
The author will earn $36.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Authors

Jens Grassel

Jens Grassel is the CTO and founder of Wegtam, a company specialised in data integration and search technology. He is programming in a plethora of languages and engineering software systems since the fall of the Wall. For some years now his focus has shifted to functional programming languages.

He has contributed to numerous free software projects and likes to apply free and open source technologies wherever applicable.

Andre Schütz

Andre Schütz is the COO and founder of Wegtam, a software company specialised in products for data integration, interface management and search technology. He constructs and develops software systems in various programming languages - the focus on functional programming concepts.

Another main focus is the MAXIMAL EINFACH podcast. More information at https://www.andreschuetz.com.

Furthermore, he creates fiction, non-fiction and children's books.

Contents

Table of Contents

Vorwort

  1. Einleitung
  2. Aufbau des Buches
  3. Konventionen für den Quelltext
  4. Schutzmarken und Copyrights
  5. Logos und Bilder
  6. Quelltext zum Buch
  7. IEinrichtung der Werkzeuge und Einführung in Scala

1Werkzeuge

  1. 1.1Java
  2. 1.2SBT
  3. 1.2.1Installation
  4. 1.2.2Nützliches für SBT
  5. 1.3Entwicklungsumgebung

2Programmierung in Scala

  1. 2.1Interaktive Programmierung via REPL
  2. 2.2Hinweise zu Datenstrukturen (var, val)
  3. 2.3Schnelleinstieg in die funktionale Programmierung
  4. 2.3.1Auswertungsstrategien (evaluation strategies)
  5. 2.3.2Scopes und Blöcke
  6. 2.3.3Semikolons und Infix-Operatoren
  7. 2.3.4Tail-Rekursion
  8. 2.3.5Funktionen höherer Ordnung (Higher Order Functions)
  9. 2.3.6Currying
  10. 2.3.7Polymorphismus
  11. 2.3.8Pattern-Matching
  12. 2.3.9Implizite Parameter
  13. 2.4Hilfsmittel zur Unterstützung
  14. 2.5Reduzierung von “Boilerplate” Code
  15. IIEinführung und Grundlagen zu den verwendeten Technologien

3Play Framework

  1. 3.1Erstellen einer Play Anwendung
  2. 3.1.1Play Anwendung über Schablonen erstellen
  3. 3.1.2Play Anwendung von Hand erstellen
  4. 3.2Projektstruktur
  5. 3.2.1Verzeichnisse, SBT-Einstellungen und Abhängigkeiten
  6. 3.2.2Unterprojekte
  7. 3.3Requests, Routing und Controller
  8. 3.3.1Requests
  9. 3.3.2Routing
  10. 3.3.3Controller
  11. 3.4Templates (Twirl)
  12. 3.4.1Wiederverwendung von Templates
  13. 3.5Mehrsprachigkeit (Internationalisierung)
  14. 3.5.1Messages Objekt
  15. 3.6Formulare
  16. 3.6.1Formdefinition
  17. 3.6.2Form-Objekte und ihre Typen
  18. 3.6.3Beispiele für Formulare
  19. 3.6.4Verarbeitung von Formularen
  20. 3.6.5Formulardarstellung in Template View
  21. 3.6.6Beispiel mit sich wiederholenden Elementen
  22. 3.7Datenbankkonfiguration
  23. 3.7.1Konfiguration von Slick für Play
  24. 3.8Datenbankzugriff
  25. 3.9Asynchrone Programmierung mit Play
  26. 3.9.1Websockets
  27. 3.10Webservices
  28. 3.11Migration von Play 2.5 auf 2.6
  29. 3.11.1Was hat sich geändert
  30. 3.11.2SBT 0.13.15 erforderlich
  31. 3.11.3Guice und OpenId Unterstützung ausgelagert
  32. 3.11.4Bereitstellung neuer Controller Klassen
  33. 3.11.5Assets
  34. 3.11.6Play WS
  35. 3.11.7Anpassungen bei i18n
  36. 3.11.8Cache
  37. 3.11.9Veränderungen an der Scala Configuration API
  38. 3.11.10Entfernung diverser APIs und Bibliotheken
  39. 3.11.11play.api.libs.concurrent.Execution ist nun veraltet
  40. 3.11.12Neue Standardfilter
  41. 3.12Konfiguration von Ehcache
  42. 3.13Ausführen mit IntelliJ IDEA und Debuggen

4Akka

  1. 4.1Einrichten einer Akka Anwendung
  2. 4.2Akka Grundlagen
  3. 4.2.1Aktorsystem und Aktoren
  4. 4.2.2Supervision
  5. 4.2.3Aktorreferenzen
  6. 4.2.4Nachrichten und deren Auslieferung
  7. 4.2.5Konfiguration
  8. 4.3Aktoren
  9. 4.3.1DeathWatch
  10. 4.3.2Nachrichten
  11. 4.3.3Aktoren beenden
  12. 4.3.4FSM
  13. 4.3.5Persistenz
  14. 4.3.6Tests
  15. 4.4Aktorenhilfsmittel
  16. 4.4.1Event-Bus
  17. 4.4.2Logging
  18. 4.4.3Scheduler
  19. 4.4.4Zeitdauer (Duration)
  20. 4.4.5Unterbrecher (Circuit Breaker)
  21. 4.5Streams

5Scala.js

  1. 5.1Erstellen einer Scala.js Anwendung
  2. 5.2Abhängigkeiten
  3. 5.3Module exportieren
  4. 5.4Cross-Compile
  5. 5.5Testen
  6. IIIAnwendungsszenario

6Das Frontend

7Das Online-Spiel

  1. IVDas Frontend

8Erstellung und Konfiguration einer Basis-Play-Anwendung

9Einbindung von Silhouette als Authentifikations-Framework

10Anmeldung der Nutzer am System

  1. 10.1Konfiguration des Backend Store (PostgreSQL)
  2. 10.2Definition des Nutzermodells
  3. 10.3Erstellen einer Datenbank-Evolution
  4. 10.4Tabellendefinition innerhalb der Anwendung
  5. 10.5DAOs für den Zugriff auf die Nutzerdaten
  6. 10.6Silhouette Konfiguration auf eigene DAOs umstellen
  7. 10.7Konfiguration der Social-Provider
  8. 10.8Funktionalität für das Löschen eines Accounts

11Suchen und Verwalten von Freunden

  1. 11.1Erweiterung des Nutzermodells um einen Nutzernamen
  2. 11.2Registrierung der Nutzer mit Nutzernamen und E-Mail
  3. 11.3Evolution und Tabellendefinitionen für Freundeslisten
  4. 11.4Funktionalitäten für Freundeslisten in einem DAO
  5. 11.5Erstellen von WebSockets zur dynamischen Interaktion
  6. 11.5.1Erstellen des WebSocket auf Basis eines Actors
  7. 11.5.2Controller als Endpunkt für das WebSocket
  8. 11.5.3Verbinden der Action innerhalb des Routing
  9. 11.5.4Erstellen von Funktionen innerhalb des Javascript, welche mit dem WebSocket zusammen arbeiten
  10. 11.6Erweiterung des CSR für WebSockets
  11. 11.7Visualisierung der Freundeslisten
  12. 11.8Erweiterung der Views zur Übergabe von Skripten und CSS

12Migration auf Play 2.6 und Silhouette 5

  1. 12.1Upgrade der benötigten Abhängigkeiten
  2. 12.2Anpassungen für das Upgrade von Silhouette
  3. 12.3Änderungen im CustomPostgresDriver
  4. 12.4Neue Controller-Klassen
  5. 12.5Von WebJarAssets zu AssetsFinder
  6. 12.6Anpassungen für die Änderungen in i18n
  7. 12.7Impliziter ExecutionContext
  8. 12.8Refactoring (Compiler-Warnungen)
  9. VDas Spiel

13Regeln und Spielverlauf

14Umsetzung

  1. 14.1Grundlegende Datentypen
  2. 14.2Operationen auf einem Spielstand
  3. 14.3Operationen auf einem Spielfeld
  4. 14.4Nutzung von Eq (Cats)
  5. 14.5Datenbank (Repository)
  6. 14.6Zeichnen von Spielfeldern im Client
  7. 14.7Hilfsfunktionen
  8. 14.7.1Websocket-URL berechnen
  9. 14.7.2Feldgröße zum Zeichnen berechnen
  10. 14.7.3Berechnen der Klickposition in einem Spielfeld
  11. 14.7.4Logging
  12. 14.8Spielvorbereitung (Preparation)
  13. 14.8.1Globale Variablen
  14. 14.8.2Struktur der HTML-Datei
  15. 14.8.3Funktionen
  16. 14.8.4Websocket
  17. 14.8.5Aufruf und Initialisierung
  18. 14.9Spielablauf (Game)
  19. 14.9.1Globale Variablen
  20. 14.9.2Struktur der HTML-Datei
  21. 14.9.3Funktionen
  22. 14.9.4Websocket
  23. 14.9.5Aufruf und Initialisierung

15Integration ins Frontend

  1. 15.1Verzeichnisstruktur
  2. 15.1.1Aktoren, Controller, DAO und Modelle
  3. 15.1.2View-Templates
  4. 15.2Datenbankschicht (Repository) als DAO
  5. 15.3Websocket
  6. 15.3.1Eine Websocket-Algebra
  7. 15.3.2Komposition zum fertigen Websocket
  8. 15.4Controller und Routing
  9. 15.4.1Übersichtsseite
  10. 15.4.2Spielerstellung
  11. 15.4.3Löschen eines Spielstandes
  12. 15.4.4Dem Spiel beitreten
  13. 15.4.5Das Spiel
  14. 15.4.6Spielvorbereitung
  15. 15.4.7Websocket
  16. 15.5Views
  17. VIDeployment (Auslieferung)

16Konfiguration für den Produktivbetrieb

17Erstellen eines Artefakts mit allen Abhängigkeiten

18Erstellen von Paketen für Debian

  1. 18.1Systemstart-Skripte

19Auslieferung zu einem Cloud Service

  1. 19.1Deployment via Remote Repository
  2. 19.2Deployment mittels des Plugins sbt-heroku
  3. 19.3Datenbankzugriff bei Heroku
  4. VIIErkenntnisse

20Silhouette

  1. 20.1Abhängigkeiten von anderen Bibliotheken
  2. 20.2Aufwand durch inkompatible Änderungen

21Circe

  1. 21.1Erstellung von Codecs
  2. 21.1.1Vollautomatische Ableitung
  3. 21.1.2Halbautomatische Ableitung
  4. 21.1.3Manuelle Implementierung
  5. 21.2Geschwindigkeit des Compilers
  6. 21.3Fehlerhäufigkeit

WTFM - Write that fucking manual!

  1. Vorteile für bereits involvierte Entwickler
  2. Vorteile für neue Entwickler

Danke

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub