SlideShare a Scribd company logo
1 of 43
Download to read offline
Thursday, March 14, 13
Structuring apps in Scala
               a.k.a.
   I have no idea what I’m doing
                                      phil calçado
                                       @pcalcado
                                http://philcalcado.com

                         Scala User Group - Berlin Brandenburg
Thursday, March 14, 13
WHY BOTHER?




Thursday, March 14, 13
SOLVING INTERESTING
                     PROBLEMS




Thursday, March 14, 13
SOLVING INTERESTING
                     PROBLEMS
                        meh.



Thursday, March 14, 13
SOLVING BORING
                           PROBLEMS IN A
                         INTERESTING WAY



Thursday, March 14, 13
SOLVING BORING
                           PROBLEMS IN A
                         INTERESTING WAY
                              hell yeah!

Thursday, March 14, 13
SOUNDCLOUD
     DEVELOPER CHALLENGE’S
           TEST SUITE



Thursday, March 14, 13
Recruitment Challenge



                          W(hy)TF?




Thursday, March 14, 13
Old Challenge



                   Build me a file uploader




Thursday, March 14, 13
Old Challenge



                   Build me a file uploader
                            Boring



Thursday, March 14, 13
Old Challenge



                   Build me a file uploader
                             Boring
                        Use flash plugin

Thursday, March 14, 13
Old Challenge



                   Build me a file uploader
                             Boring
                        Use flash plugin
                        Not enough code
Thursday, March 14, 13
New Challenge

              Given a series of events
             and a bunch of connected
               clients, who should be
             notified of which events?


Thursday, March 14, 13
What I’m used to




Thursday, March 14, 13
What I’m used to




Thursday, March 14, 13
Combinators all the way down




Thursday, March 14, 13
a LOT of code




Thursday, March 14, 13
a LOT of wiring




Thursday, March 14, 13
not leveraging
                         the type system




Thursday, March 14, 13
I am pretty sure
                         I’m doing it wrong.




Thursday, March 14, 13
TWITTER




Thursday, March 14, 13
Instance-Based Injection




Thursday, March 14, 13
Extremely thin, orthogonal, traits




Thursday, March 14, 13
Use method visibility




Thursday, March 14, 13
TYPESAFE/PRECOG




Thursday, March 14, 13
Modules are abstract




Thursday, March 14, 13
typesafe: self-types for
                       dependencies




Thursday, March 14, 13
Precog: Instead of import,
                 extends or with




Thursday, March 14, 13
SOUNDCLOUD
                            APPS



Thursday, March 14, 13
ACTUALLY, HOW ARE WE
             BUILDING APPS?




Thursday, March 14, 13
internet




                         Legacy Application
                               (Rails)




                              Database




Thursday, March 14, 13
internet




                                                    API




                            Sounds        Users              Stats       Stream




                         Notifications   Settings         Recommender   Messaging




Thursday, March 14, 13
SOUNDCLOUD
                            APPS



Thursday, March 14, 13
A LOT LIKE
                         TYPESAFE’S




Thursday, March 14, 13
Controllers define dependency
        on components




Thursday, March 14, 13
Components are abstract




Thursday, March 14, 13
One flat instance




Thursday, March 14, 13
I was pretty sure
                         I was doing it wrong.




Thursday, March 14, 13
I am pretty sure
                    I’m still doing it wrong.




Thursday, March 14, 13
I am pretty sure
                    I’m still doing it wrong.

                         what do you use?


Thursday, March 14, 13
REFERENCES

            •     http://bit.ly/pcalcado-goto
            •     http://bit.ly/effective-scala-Dependency-injection
            •     http://bit.ly/Bakery-from-the-Black-Lagoon
            •     http://bit.ly/Martin-Odersky-Reflection-and-
                  Compilers




Thursday, March 14, 13
phil calçado


                         http://philcalcado.com
                               @pcalcado



                              www.soundcloud.com




Thursday, March 14, 13

More Related Content

Viewers also liked

Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
Phil Calçado
 

Viewers also liked (20)

APIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodAPIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog Food
 
Os cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web DesignOs cuidados e os limites do Responsive Web Design
Os cuidados e os limites do Responsive Web Design
 
CSS 4 - What's coming up
CSS 4 - What's coming upCSS 4 - What's coming up
CSS 4 - What's coming up
 
Cloud Reliability Patterns
Cloud Reliability PatternsCloud Reliability Patterns
Cloud Reliability Patterns
 
Desafio dos testes em uma arquitetura de micro serviços
Desafio dos testes em uma arquitetura de micro serviçosDesafio dos testes em uma arquitetura de micro serviços
Desafio dos testes em uma arquitetura de micro serviços
 
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
 
ScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a Function
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
 
Rhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a FunctionRhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a Function
 
Vida longa para SOA com microservices
Vida longa para SOA com microservicesVida longa para SOA com microservices
Vida longa para SOA com microservices
 
Microservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenosMicroservices - Quebrando gigantes em pequenos
Microservices - Quebrando gigantes em pequenos
 
Amadurecendo Equipes com Microservices
Amadurecendo Equipes com MicroservicesAmadurecendo Equipes com Microservices
Amadurecendo Equipes com Microservices
 
Um pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoftUm pequeno estudo sobre a microsoft
Um pequeno estudo sobre a microsoft
 
Integração utilizando REST API e Microservices
Integração utilizando REST API e MicroservicesIntegração utilizando REST API e Microservices
Integração utilizando REST API e Microservices
 
Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.Flexbox and Grid Layout: How you will structure layouts tomorrow.
Flexbox and Grid Layout: How you will structure layouts tomorrow.
 
Microservices
MicroservicesMicroservices
Microservices
 
DOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render PathDOM, CSSOM e RenderThree - Introdução ao Browser Render Path
DOM, CSSOM e RenderThree - Introdução ao Browser Render Path
 
Introdução à Microservices
Introdução à MicroservicesIntrodução à Microservices
Introdução à Microservices
 
Workshop soa, microservices e devops
Workshop soa, microservices e devopsWorkshop soa, microservices e devops
Workshop soa, microservices e devops
 
Microservices: uma abordagem para arquitetura de aplicações (Devcamp 2015)
Microservices: uma abordagem para arquitetura de aplicações (Devcamp 2015)Microservices: uma abordagem para arquitetura de aplicações (Devcamp 2015)
Microservices: uma abordagem para arquitetura de aplicações (Devcamp 2015)
 

Similar to Structuring apps in Scala

Making meaning with mobile apps
Making meaning with mobile appsMaking meaning with mobile apps
Making meaning with mobile apps
Richard Byrne
 
Roncalli i pad intro presentation
Roncalli i pad intro presentationRoncalli i pad intro presentation
Roncalli i pad intro presentation
Scrappyvore
 
Borg - Resistance is futile: how implementing next generation discovery syste...
Borg - Resistance is futile: how implementing next generation discovery syste...Borg - Resistance is futile: how implementing next generation discovery syste...
Borg - Resistance is futile: how implementing next generation discovery syste...
IL Group (CILIP Information Literacy Group)
 

Similar to Structuring apps in Scala (20)

Google’s Fuel For Your Marketing Machine - A Workshop In Aspen For Industry P...
Google’s Fuel For Your Marketing Machine - A Workshop In Aspen For Industry P...Google’s Fuel For Your Marketing Machine - A Workshop In Aspen For Industry P...
Google’s Fuel For Your Marketing Machine - A Workshop In Aspen For Industry P...
 
Fed2013_Managing Workplace Productivity
Fed2013_Managing Workplace ProductivityFed2013_Managing Workplace Productivity
Fed2013_Managing Workplace Productivity
 
Native Javascript apps with PhoneGap
Native Javascript apps with PhoneGapNative Javascript apps with PhoneGap
Native Javascript apps with PhoneGap
 
Soflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developersSoflophp 2013 - SysAdmin skills for PHP developers
Soflophp 2013 - SysAdmin skills for PHP developers
 
Unmoderated User Testing
Unmoderated User TestingUnmoderated User Testing
Unmoderated User Testing
 
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
IAS13: Metadata in the Cross-Channel Ecosystem: Consistency, Context and Inte...
 
The Changing Nature of Brand Experience in Higher Education
The Changing Nature of Brand Experience in Higher EducationThe Changing Nature of Brand Experience in Higher Education
The Changing Nature of Brand Experience in Higher Education
 
Test Driven Infrastructure Development
Test Driven Infrastructure DevelopmentTest Driven Infrastructure Development
Test Driven Infrastructure Development
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
 
Future layouts
Future layoutsFuture layouts
Future layouts
 
THE MISSING MANUAL FOR DATA SCIENCE: REMIX. RESUSE. REPRODUCE from Structure:...
THE MISSING MANUAL FOR DATA SCIENCE: REMIX. RESUSE. REPRODUCE from Structure:...THE MISSING MANUAL FOR DATA SCIENCE: REMIX. RESUSE. REPRODUCE from Structure:...
THE MISSING MANUAL FOR DATA SCIENCE: REMIX. RESUSE. REPRODUCE from Structure:...
 
Making meaning with mobile apps
Making meaning with mobile appsMaking meaning with mobile apps
Making meaning with mobile apps
 
TDD at Smartbear
TDD at SmartbearTDD at Smartbear
TDD at Smartbear
 
Engine on Rails
Engine on RailsEngine on Rails
Engine on Rails
 
Hybrid Mobile Web Apps with Sencha Touch 2
Hybrid Mobile Web Apps with Sencha Touch 2Hybrid Mobile Web Apps with Sencha Touch 2
Hybrid Mobile Web Apps with Sencha Touch 2
 
Roncalli i pad intro presentation
Roncalli i pad intro presentationRoncalli i pad intro presentation
Roncalli i pad intro presentation
 
Drupal without coding
Drupal without codingDrupal without coding
Drupal without coding
 
Connected Educator flenj 2013
Connected Educator flenj 2013Connected Educator flenj 2013
Connected Educator flenj 2013
 
NNSTOY A Framework of Fun:Learning Through and From Games
NNSTOY A Framework of Fun:Learning Through and From Games NNSTOY A Framework of Fun:Learning Through and From Games
NNSTOY A Framework of Fun:Learning Through and From Games
 
Borg - Resistance is futile: how implementing next generation discovery syste...
Borg - Resistance is futile: how implementing next generation discovery syste...Borg - Resistance is futile: how implementing next generation discovery syste...
Borg - Resistance is futile: how implementing next generation discovery syste...
 

More from Phil Calçado

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
Phil Calçado
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
Phil Calçado
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
Phil Calçado
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
Phil Calçado
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Phil Calçado
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
Phil Calçado
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
Phil Calçado
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular API
Phil Calçado
 
SoundCloud Masterclass on Brazil
SoundCloud Masterclass on BrazilSoundCloud Masterclass on Brazil
SoundCloud Masterclass on Brazil
Phil Calçado
 
SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...
Phil Calçado
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
Phil Calçado
 

More from Phil Calçado (20)

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing Microservices
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of Microservices
 
The Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbaneThe Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 Brisbane
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloud
 
A Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsA Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing Organisations
 
Finagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloudFinagle-Based Microservices at SoundCloud
Finagle-Based Microservices at SoundCloud
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
 
From a monolithic Ruby on Rails app to the JVM
From a monolithic  Ruby on Rails app  to the JVMFrom a monolithic  Ruby on Rails app  to the JVM
From a monolithic Ruby on Rails app to the JVM
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular API
 
SoundCloud Masterclass on Brazil
SoundCloud Masterclass on BrazilSoundCloud Masterclass on Brazil
SoundCloud Masterclass on Brazil
 
SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...SpeakerConf: my findings in trying to use this functional programming busines...
SpeakerConf: my findings in trying to use this functional programming busines...
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
 
(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development
 

Structuring apps in Scala