SlideShare a Scribd company logo
1 of 22
A RESTy-JSON API
with spray.io and maven
sponsored by special appearance
Ignasi Marimon-Clos i Sunyol
@ignasi35
#scalabcn
Sunday, June 16, 13
thanks!
Sunday, June 16, 13
special thank you’s
JPradel (@agile_jordi): review and organization
JCasadellà (@jcasadella): review
JRudolph for simplifying step 4
https://github.com/jrudolph/scala-meetup-spray/commit/
c4991938ec7b26b183d701aac73949e7822cf45e
Sunday, June 16, 13
about me
n. /iŋ'nazi/
1) problem solver, Garbage Collector, mostly
java, learning scala, some agile
2) kayaker
3) under construction
4) wears glasses
Sunday, June 16, 13
what we saw
• BDD (cucumber)
• TDD (scalatest)
• sbt (inifinite run)
• intelliJ
• JAX-RS
• Jetty
https://github.com/funcio/bdd-jaxrs-hands-on
Sunday, June 16, 13
what we’ll see
• BDD (cucumber)
• TDD (scalatest)
• sbt (inifinite run)
• intelliJ
• JAX-RS
• Jetty
• BDD (jbehave?)
• TDD (scalatest)
• mvn (infinite run)
• eclipse (worksheet)
• spray-can/https/...
• spray-json
https://github.com/ignasi35/scala-meetup-spray
Sunday, June 16, 13
why? (1/2)
• I’m comfy with eclipse
• I’m comfy with maven (I know that’s weird)
• (no more)Typesafe delivers a prepacked env
• still there s/where
• eclipse-maven integration is solid
• I needed infinite-test in maven at work
• I like trolling Jordi and Jose
Sunday, June 16, 13
why? (2/2)
• spray.io has akka
• spray 1.x has akka 2.x
• spray.io is modularized (that’s useful)
• I don’t need java API (@see play)
• spray-json is f*&[ing simple (via shapeless)
http://spray.io/project-info/current-versions/
Sunday, June 16, 13
why? (bonus)
• spray.io beats all other JVM stacks/fw (*)
http://www.techempower.com/benchmarks/
Sunday, June 16, 13
spray
modules
provided
provided
There’s more provided dep’s
than those labelled but we don’t
need that level of detail now.
credit: graphic made using yuml.me
http://yuml.me/diagram/scruffy/class/[A]->[B],[A]->[C],[B]->[C]
Sunday, June 16, 13
spray
• One thing done right
• spray-routing => simple entry point.
• @sirthias (Mathias Doenitz) in Akka 2.2
• magnet pattern
• alternate to method overload
• IOBridge, directives, Marshallers, ...???
Sunday, June 16, 13
Sunday, June 16, 13
step 1
• Given an HTTP server
• When I GET /hello
• Then I obtain “hello”
Sunday, June 16, 13
step 1 (tips)
• Edit a web.xml
• Create a mapping
• Provide a BeanConnectionBeanFactory
• Add a servers.xml
• Invoke the Olds Gods and the New
Sunday, June 16, 13
specially dedicated to @ch4lit
Sunday, June 16, 13
step 2
• Given an HTTP server
• When I GET /hello.json
• Then I obtain “{msg:‘world’}”
Sunday, June 16, 13
directives + complete
• path/pathPrefix/pathTest
• authenticate
• get/post/delete/...
• decodeRequest/encodeResponse/...
• cache/alwaysCache/...
• complete
http://spray.io/documentation/spray-routing/predefined-directives-alphabetically/
Sunday, June 16, 13
step 3
• Given an HTTP server
• When I GET /books.json
• Then I obtain the complete books stock
Sunday, June 16, 13
step 4
• Given an HTTP server
• And I POST a book.txt in /books
• When I GET /books.json
• Then I obtain the updated books stock
MEGA-KUDOS to
https://github.com/jrudolph
Sunday, June 16, 13
step 5
• Given an HTTP server
• And a programmatic HTTP client
• When I GET /hello.json
• Then I obtain “{msg:‘world’}”
Sunday, June 16, 13
conclusions
• scala in maven is tough
• mvn plugin lacks infini-run, infini-install,...
• scala worksheet rocks
• spray allows a quick entry point
• docs and examples still to be improved
• because I’m very dumb
• ...
Sunday, June 16, 13
thanks!
Sunday, June 16, 13

More Related Content

Viewers also liked

Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5UC Davis
 
Ppt microencapsulation
Ppt microencapsulationPpt microencapsulation
Ppt microencapsulationSANA TABASSUM
 
SPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESuriyati Yusoff
 
power-plant-basics
power-plant-basicspower-plant-basics
power-plant-basicskulanji Siva
 
Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Harshil Darji
 
Flowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyFlowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyCreately
 

Viewers also liked (12)

Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5Pesticide Training Course UC Davis, Safety. Part 5 of 5
Pesticide Training Course UC Davis, Safety. Part 5 of 5
 
Ppt microencapsulation
Ppt microencapsulationPpt microencapsulation
Ppt microencapsulation
 
Tuna
Tuna Tuna
Tuna
 
SPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURESPM Paper 2 Esei: FORCE AND PRESSURE
SPM Paper 2 Esei: FORCE AND PRESSURE
 
Hptlc (rajat)
Hptlc  (rajat)Hptlc  (rajat)
Hptlc (rajat)
 
Chemical Reactors
Chemical ReactorsChemical Reactors
Chemical Reactors
 
power-plant-basics
power-plant-basicspower-plant-basics
power-plant-basics
 
Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)Blood Bank Management System (including UML diagrams)
Blood Bank Management System (including UML diagrams)
 
Ceramics
CeramicsCeramics
Ceramics
 
Bank Management System
Bank Management SystemBank Management System
Bank Management System
 
Flowchart Diagram Templates by Creately
Flowchart Diagram Templates by CreatelyFlowchart Diagram Templates by Creately
Flowchart Diagram Templates by Creately
 

Similar to Spray & Maven Intro for Scala Barcelona Developers Meetup

Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureDmitry Buzdin
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9jClarity
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Olaf Alders
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Martijn Verburg
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby ConferenceJohn Woodell
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofMani Sarkar
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁charsbar
 
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...PatrickCrompton
 
Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Michael Redlich
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develomentchristkv
 
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013Aerial Services
 
How Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationHow Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationGibson Fahnestock
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013gwhathistory
 
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerApcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerhewie
 
Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Francesco Laurita
 
Laug comet intro july 2010
Laug comet intro july 2010Laug comet intro july 2010
Laug comet intro july 2010Skills Matter
 
London Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet PanelLondon Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet Paneldylanks
 
Open GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionOpen GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionRichard Cantwell
 

Similar to Spray & Maven Intro for Scala Barcelona Developers Meetup (20)

Odnoklassniki.ru Architecture
Odnoklassniki.ru ArchitectureOdnoklassniki.ru Architecture
Odnoklassniki.ru Architecture
 
The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9The Diabolical Developer's Guide to Surviving Java 9
The Diabolical Developer's Guide to Surviving Java 9
 
Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013Ab(Using) the MetaCPAN API for Fun and Profit v2013
Ab(Using) the MetaCPAN API for Fun and Profit v2013
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
 
sbt 1
sbt 1sbt 1
sbt 1
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
Ljc conf open jdk betterrev bof
Ljc conf open jdk betterrev bofLjc conf open jdk betterrev bof
Ljc conf open jdk betterrev bof
 
萬國之津梁
萬國之津梁萬國之津梁
萬國之津梁
 
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
 
Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)Java Advanced Features (TCF 2014)
Java Advanced Features (TCF 2014)
 
Lessons from 4 years of driver develoment
Lessons from 4 years of driver develomentLessons from 4 years of driver develoment
Lessons from 4 years of driver develoment
 
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013“Webmapping Solutions: Technology & Tips” -- November 13, 2013
“Webmapping Solutions: Technology & Tips” -- November 13, 2013
 
How Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js FoundationHow Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js Foundation
 
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
Lessons Learned Setting Up the OSM Stack Workshop SotM US 2013
 
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schulerApcug 2011 07-17-intro_to_drupal_jeff_schuler
Apcug 2011 07-17-intro_to_drupal_jeff_schuler
 
Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013Roll your own web crawler. RubyDay 2013
Roll your own web crawler. RubyDay 2013
 
Laug comet intro july 2010
Laug comet intro july 2010Laug comet intro july 2010
Laug comet intro july 2010
 
London Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet PanelLondon Ajax User Group Meetup: Comet Panel
London Ajax User Group Meetup: Comet Panel
 
Open GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An IntroductionOpen GeoData, Open GeoTools: An Introduction
Open GeoData, Open GeoTools: An Introduction
 
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
Javantura v4 - CroDuke Indy and the Kingdom of Java Skills - Branko Mihaljevi...
 

More from Ignasi Marimon-Clos i Sunyol (9)

The Emperor Has No Docs (Geecon Oct'23)
The Emperor Has No Docs (Geecon Oct'23)The Emperor Has No Docs (Geecon Oct'23)
The Emperor Has No Docs (Geecon Oct'23)
 
Jeroglificos, Minotauros y la factura de la luz
Jeroglificos, Minotauros y la factura de la luzJeroglificos, Minotauros y la factura de la luz
Jeroglificos, Minotauros y la factura de la luz
 
Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)
 
Contributing to OSS (Scalator 2020-01-22)
Contributing to OSS (Scalator 2020-01-22)Contributing to OSS (Scalator 2020-01-22)
Contributing to OSS (Scalator 2020-01-22)
 
Reactive Microsystems (Sw Crafters Barcelona 2018)
Reactive Microsystems (Sw Crafters Barcelona 2018)Reactive Microsystems (Sw Crafters Barcelona 2018)
Reactive Microsystems (Sw Crafters Barcelona 2018)
 
Lagom Workshop BarcelonaJUG 2017-06-08
Lagom Workshop  BarcelonaJUG 2017-06-08Lagom Workshop  BarcelonaJUG 2017-06-08
Lagom Workshop BarcelonaJUG 2017-06-08
 
Functional Programming in JAVA 8
Functional Programming in JAVA 8Functional Programming in JAVA 8
Functional Programming in JAVA 8
 
Scala 101-bcndevcon
Scala 101-bcndevconScala 101-bcndevcon
Scala 101-bcndevcon
 
Scala 101
Scala 101Scala 101
Scala 101
 

Recently uploaded

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Spray & Maven Intro for Scala Barcelona Developers Meetup

  • 1. A RESTy-JSON API with spray.io and maven sponsored by special appearance Ignasi Marimon-Clos i Sunyol @ignasi35 #scalabcn Sunday, June 16, 13
  • 3. special thank you’s JPradel (@agile_jordi): review and organization JCasadellà (@jcasadella): review JRudolph for simplifying step 4 https://github.com/jrudolph/scala-meetup-spray/commit/ c4991938ec7b26b183d701aac73949e7822cf45e Sunday, June 16, 13
  • 4. about me n. /iŋ'nazi/ 1) problem solver, Garbage Collector, mostly java, learning scala, some agile 2) kayaker 3) under construction 4) wears glasses Sunday, June 16, 13
  • 5. what we saw • BDD (cucumber) • TDD (scalatest) • sbt (inifinite run) • intelliJ • JAX-RS • Jetty https://github.com/funcio/bdd-jaxrs-hands-on Sunday, June 16, 13
  • 6. what we’ll see • BDD (cucumber) • TDD (scalatest) • sbt (inifinite run) • intelliJ • JAX-RS • Jetty • BDD (jbehave?) • TDD (scalatest) • mvn (infinite run) • eclipse (worksheet) • spray-can/https/... • spray-json https://github.com/ignasi35/scala-meetup-spray Sunday, June 16, 13
  • 7. why? (1/2) • I’m comfy with eclipse • I’m comfy with maven (I know that’s weird) • (no more)Typesafe delivers a prepacked env • still there s/where • eclipse-maven integration is solid • I needed infinite-test in maven at work • I like trolling Jordi and Jose Sunday, June 16, 13
  • 8. why? (2/2) • spray.io has akka • spray 1.x has akka 2.x • spray.io is modularized (that’s useful) • I don’t need java API (@see play) • spray-json is f*&[ing simple (via shapeless) http://spray.io/project-info/current-versions/ Sunday, June 16, 13
  • 9. why? (bonus) • spray.io beats all other JVM stacks/fw (*) http://www.techempower.com/benchmarks/ Sunday, June 16, 13
  • 10. spray modules provided provided There’s more provided dep’s than those labelled but we don’t need that level of detail now. credit: graphic made using yuml.me http://yuml.me/diagram/scruffy/class/[A]->[B],[A]->[C],[B]->[C] Sunday, June 16, 13
  • 11. spray • One thing done right • spray-routing => simple entry point. • @sirthias (Mathias Doenitz) in Akka 2.2 • magnet pattern • alternate to method overload • IOBridge, directives, Marshallers, ...??? Sunday, June 16, 13
  • 13. step 1 • Given an HTTP server • When I GET /hello • Then I obtain “hello” Sunday, June 16, 13
  • 14. step 1 (tips) • Edit a web.xml • Create a mapping • Provide a BeanConnectionBeanFactory • Add a servers.xml • Invoke the Olds Gods and the New Sunday, June 16, 13
  • 15. specially dedicated to @ch4lit Sunday, June 16, 13
  • 16. step 2 • Given an HTTP server • When I GET /hello.json • Then I obtain “{msg:‘world’}” Sunday, June 16, 13
  • 17. directives + complete • path/pathPrefix/pathTest • authenticate • get/post/delete/... • decodeRequest/encodeResponse/... • cache/alwaysCache/... • complete http://spray.io/documentation/spray-routing/predefined-directives-alphabetically/ Sunday, June 16, 13
  • 18. step 3 • Given an HTTP server • When I GET /books.json • Then I obtain the complete books stock Sunday, June 16, 13
  • 19. step 4 • Given an HTTP server • And I POST a book.txt in /books • When I GET /books.json • Then I obtain the updated books stock MEGA-KUDOS to https://github.com/jrudolph Sunday, June 16, 13
  • 20. step 5 • Given an HTTP server • And a programmatic HTTP client • When I GET /hello.json • Then I obtain “{msg:‘world’}” Sunday, June 16, 13
  • 21. conclusions • scala in maven is tough • mvn plugin lacks infini-run, infini-install,... • scala worksheet rocks • spray allows a quick entry point • docs and examples still to be improved • because I’m very dumb • ... Sunday, June 16, 13