Slide 1

Slide 1 text

Scala and Clean- Architecture by Sebastian Nozzi

Slide 2

Slide 2 text

Part I Screaming

Slide 3

Slide 3 text

What do the following pictures *SCREAM* at you?

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Church?

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Stadium?

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Airport?

Slide 11

Slide 11 text

What about your codebase? What does it scream?

Slide 12

Slide 12 text

Does it scream... I'm an Accounting System! I'm a Community Portal! I'm a CRM-System!

Slide 13

Slide 13 text

Or rather... I'm a Web-based App! I use the Play-Framework! Database FTW!

Slide 14

Slide 14 text

Here's the idea Put your app, your domain problem, at the center The "web", database, framework, etc. are details

Slide 15

Slide 15 text

Part II The Concept

Slide 16

Slide 16 text

Nothing new or revolutionary really...

Slide 17

Slide 17 text

It looks like this

Slide 18

Slide 18 text

Application Core

Slide 19

Slide 19 text

Interface Adapters

Slide 20

Slide 20 text

Frameworks & Drivers

Slide 21

Slide 21 text

Whole Picture Source: https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

Slide 22

Slide 22 text

Another view Source: http://www.planetgeek.ch/2013/11/26/chop-onions-instead-of-layers/

Slide 23

Slide 23 text

Why is this good? Good Design Clean boundaries / roles Easy to fix, refactor, extend, re-use Easy and fast to test etc.

Slide 24

Slide 24 text

Good Thing™ (right?)

Slide 25

Slide 25 text

Part III Scala

Slide 26

Slide 26 text

Why is Scala well suited?

Slide 27

Slide 27 text

Scala. Recap: Object Oriented and Functional

Slide 28

Slide 28 text

Culture Language Scala

Slide 29

Slide 29 text

Some aspects: Case-classes Immutability Collections Objects val(ues) Implicits Data-transformations For-comprehensions Lazyness / Rective(ness) etc.

Slide 30

Slide 30 text

Specific to Play: Async. results (Futures) Parametrized Views Dep. Injection etc.

Slide 31

Slide 31 text

Applied to this...

Slide 32

Slide 32 text

Conclusions Clean code / architecture has its advantages Scala, the language and the culture, support these notions well

Slide 33

Slide 33 text

Some Resources by Robert C. Martin by Alistair Cockburn by Jeffrey Palermo from a post by Robert C. Martin from James Coplien, and Trygve Reenskaug by Ivar Jacobson from his book Object Oriented Software Engineering: A Use-Case Driven Approach and many more... Clean Architecture Hexagonal Architecture Onion Architecture Screaming Architecture DCI BCE

Slide 34

Slide 34 text

Questions / Discussion

Slide 35

Slide 35 text

Thanks