SlideShare a Scribd company logo
(mostly)

How we moved from
         ^

   Java to Scala
     Graham Tackley
     guardian.co.uk
History

• Java shop since 2006
• guardian.co.uk: java + spring + velocity +
  hibernate + oracle
• ~100k lines production java code (and
  ~35k xml...)
Content API
• Provide API to access all of our website
  content
• Limited beta released early 2009
• Started implementation of final version late
  2009
• Live May 2010:
  http://content.guardianapis.com
Content API


(demo of http://content.guardianapis.com)
November 2009


• Started new Content API implementation
• java + guice + guice servlets + apache solr
November 2009


• A few people had played with scala
• No production scala code
January 2010
• Comprehensive integration tests were very
  important to us
• Started writing our integration tests in
  Scala with the awesome ScalaTest
• Already a maven project, so mixed scala-
  java support easy with maven-scala-plugin


                                             demo: mavan-scala-plugin, ScalaTest
January 2010
January 2010


• A fair bit of our test code was java-
  without-semicolons as we learnt about
  Scala...
January 2010
February 2010

• ... despite that we loved it so much that
  after a month we decided to convert the
  whole app to Scala
• scala + guice + guice servlets + apache solr
Our top 5 things we
 loved about scala
    on day one
1. Sensible Class Constructors



             =>
1. Sensible Class Constructors
2. Type inference / val & var

ArrayList<String> myList = new ArrayList<String>();




                            =>

val myList = new ArrayList[String]
3. No source file naming
           constraints


• Don’t need to be named after package &
  class name like java
• So multiple classes are allowed in a single file


                                              e.g. ResponseRenderer.scala
4. REPL (console)



• run “scala” for a scala shell
• awesome for experimentation
5. Same tools, libs, deployment &
 runtime characteristics as Java

• We still use IntelliJ (with the scala plugin)
• A scala war file is just a war file
• All the experience of running jvm in
  production still applies
• Can still use java libraries

                                          e.g. GuiceServletConfig.scala, XmlFormatter.scala
Our top 5 things we
          loved about scala
             on day one

                          SUMMARY:
Scala is great even if you only use it as a more concise java
                 (java-without-semicolons™);
             for us this was a great way to start.
July 2010

• Switched from maven to simple-build-tool
• Mainly for incremental compilation
• ~ test-quick and ~ prepare-webapp also
  invaluable
Writing code
one year on
some early code...




it took us a while to realise that most of the loops we
     wrote in Java were actually “map” or “flatMap”
... ended up as




it took us a while to realise that most of the loops we
     wrote in Java were actually “map” or “flatMap”
Summary
• Migration path from Java relatively smooth
• Take it easy, and don’t fear java-without-
  semicolons in the early days
• An incremental embrace of Scala features
  worked really well for us
• Hide the Java yuk with implicit conversions
• http://content.guardianapis.com
• http://www.guardian.co.uk/open-platform
• http://github.com/guardian/open-platform-
  content-api-scala-client



 graham.tackley@guardian.co.uk ■ @tackers

More Related Content

What's hot (20)

Why akka
Why akkaWhy akka
Why akka
Sapardi Sapardi
 
Challenges of moving a java team to scala
Challenges of moving a java team to scalaChallenges of moving a java team to scala
Challenges of moving a java team to scala
João Cavalheiro
 
Alfresco Mvc - a seamless integration with Spring Mvc
Alfresco Mvc - a seamless integration with Spring MvcAlfresco Mvc - a seamless integration with Spring Mvc
Alfresco Mvc - a seamless integration with Spring Mvc
Daniel Gradecak
 
ELK Stack
ELK StackELK Stack
ELK Stack
Eberhard Wolff
 
IGN's V3 API
IGN's V3 APIIGN's V3 API
IGN's V3 API
Manish Pandit
 
Different ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail BortnykDifferent ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail Bortnyk
Ruby Meditation
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012
Lance Ball
 
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 MJ Berends talk - Women & Non-Binary Focused Intro to AWS MJ Berends talk - Women & Non-Binary Focused Intro to AWS
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
AWS Chicago
 
DevOps for Scala
DevOps for ScalaDevOps for Scala
DevOps for Scala
Michele Sciabarrà
 
Owin & katana
Owin & katanaOwin & katana
Owin & katana
Fabian Vilers
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSC
Gian Maria Ricci
 
Hello world - intro to node js
Hello world - intro to node jsHello world - intro to node js
Hello world - intro to node js
Refresh Annapolis Valley
 
Python to go
Python to goPython to go
Python to go
Weng Wei
 
SSDs are Awesome
SSDs are AwesomeSSDs are Awesome
SSDs are Awesome
Barry Abrahamson
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overview
Jan Berdajs
 
JPA 2.1 on Payara Server
JPA 2.1 on Payara ServerJPA 2.1 on Payara Server
JPA 2.1 on Payara Server
Payara
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
Andres Almiray
 
Apache Jackrabbit
Apache JackrabbitApache Jackrabbit
Apache Jackrabbit
elliando dias
 
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Yanik Berube
 
Challenges of moving a java team to scala
Challenges of moving a java team to scalaChallenges of moving a java team to scala
Challenges of moving a java team to scala
João Cavalheiro
 
Alfresco Mvc - a seamless integration with Spring Mvc
Alfresco Mvc - a seamless integration with Spring MvcAlfresco Mvc - a seamless integration with Spring Mvc
Alfresco Mvc - a seamless integration with Spring Mvc
Daniel Gradecak
 
Different ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail BortnykDifferent ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail Bortnyk
Ruby Meditation
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012Torquebox rubyhoedown-2012
Torquebox rubyhoedown-2012
Lance Ball
 
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
 MJ Berends talk - Women & Non-Binary Focused Intro to AWS MJ Berends talk - Women & Non-Binary Focused Intro to AWS
MJ Berends talk - Women & Non-Binary Focused Intro to AWS
AWS Chicago
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSC
Gian Maria Ricci
 
Python to go
Python to goPython to go
Python to go
Weng Wei
 
Rails 5 subjective overview
Rails 5 subjective overviewRails 5 subjective overview
Rails 5 subjective overview
Jan Berdajs
 
JPA 2.1 on Payara Server
JPA 2.1 on Payara ServerJPA 2.1 on Payara Server
JPA 2.1 on Payara Server
Payara
 
Taking Micronaut out for a spin
Taking Micronaut out for a spinTaking Micronaut out for a spin
Taking Micronaut out for a spin
Andres Almiray
 
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Yanik Berube
 

Viewers also liked (20)

Oir cantar o galo duas veces
Oir cantar o galo duas vecesOir cantar o galo duas veces
Oir cantar o galo duas veces
MUSEO ETNOLOXICO
 
Resume
ResumeResume
Resume
MANDIFLOR
 
241 Maddox Bc2.Indd
241 Maddox Bc2.Indd241 Maddox Bc2.Indd
241 Maddox Bc2.Indd
lmaddox
 
Models Ink Consortium Intro C1
Models Ink Consortium Intro C1Models Ink Consortium Intro C1
Models Ink Consortium Intro C1
wacotao
 
Oooooooooooo
OoooooooooooOooooooooooo
Oooooooooooo
guest946877
 
Compensation Plan
Compensation PlanCompensation Plan
Compensation Plan
jsenlytenednyc
 
#2
#2#2
#2
guest68e1e
 
Bad Body Noises
Bad Body NoisesBad Body Noises
Bad Body Noises
Daniel Fernandes
 
English Central User Guide
English Central  User  GuideEnglish Central  User  Guide
English Central User Guide
David Deubelbeiss
 
5 myths whitepaper
5 myths whitepaper5 myths whitepaper
5 myths whitepaper
Jordan Baines
 
Skmbt C20309052614021
Skmbt C20309052614021Skmbt C20309052614021
Skmbt C20309052614021
guest19a3bac
 
Action Asia May/June 09
Action Asia May/June 09Action Asia May/June 09
Action Asia May/June 09
Maxout Hydrosports
 
Введение в маркетинг клиентских баз данных
Введение в маркетинг клиентских баз данныхВведение в маркетинг клиентских баз данных
Введение в маркетинг клиентских баз данных
Dmitriy Isaev
 
Viatge Estudis
Viatge EstudisViatge Estudis
Viatge Estudis
imagenius
 
Victoria Tattersdill - Young Risk Professional interview
Victoria Tattersdill -  Young Risk Professional interviewVictoria Tattersdill -  Young Risk Professional interview
Victoria Tattersdill - Young Risk Professional interview
FERMA
 
Ethnoomusicology v 55 n 3 2011
Ethnoomusicology v 55 n 3  2011Ethnoomusicology v 55 n 3  2011
Ethnoomusicology v 55 n 3 2011
MUSEO ETNOLOXICO
 
Проверка знаний
Проверка знанийПроверка знаний
Проверка знаний
Marina Kalinkina
 
O ribeiro na terra do viño
O ribeiro na terra do viñoO ribeiro na terra do viño
O ribeiro na terra do viño
MUSEO ETNOLOXICO
 
Oir cantar o galo duas veces
Oir cantar o galo duas vecesOir cantar o galo duas veces
Oir cantar o galo duas veces
MUSEO ETNOLOXICO
 
241 Maddox Bc2.Indd
241 Maddox Bc2.Indd241 Maddox Bc2.Indd
241 Maddox Bc2.Indd
lmaddox
 
Models Ink Consortium Intro C1
Models Ink Consortium Intro C1Models Ink Consortium Intro C1
Models Ink Consortium Intro C1
wacotao
 
Skmbt C20309052614021
Skmbt C20309052614021Skmbt C20309052614021
Skmbt C20309052614021
guest19a3bac
 
Введение в маркетинг клиентских баз данных
Введение в маркетинг клиентских баз данныхВведение в маркетинг клиентских баз данных
Введение в маркетинг клиентских баз данных
Dmitriy Isaev
 
Viatge Estudis
Viatge EstudisViatge Estudis
Viatge Estudis
imagenius
 
Victoria Tattersdill - Young Risk Professional interview
Victoria Tattersdill -  Young Risk Professional interviewVictoria Tattersdill -  Young Risk Professional interview
Victoria Tattersdill - Young Risk Professional interview
FERMA
 
Ethnoomusicology v 55 n 3 2011
Ethnoomusicology v 55 n 3  2011Ethnoomusicology v 55 n 3  2011
Ethnoomusicology v 55 n 3 2011
MUSEO ETNOLOXICO
 
Проверка знаний
Проверка знанийПроверка знаний
Проверка знаний
Marina Kalinkina
 
O ribeiro na terra do viño
O ribeiro na terra do viñoO ribeiro na terra do viño
O ribeiro na terra do viño
MUSEO ETNOLOXICO
 

Similar to Java to scala (20)

LSUG: How we (mostly) moved from Java to Scala
LSUG: How we (mostly) moved from Java to ScalaLSUG: How we (mostly) moved from Java to Scala
LSUG: How we (mostly) moved from Java to Scala
Graham Tackley
 
Java to Scala: Why & How
Java to Scala: Why & HowJava to Scala: Why & How
Java to Scala: Why & How
Graham Tackley
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mix
Stefano Galarraga
 
Java basics at Lara Technologies
Java basics at Lara TechnologiesJava basics at Lara Technologies
Java basics at Lara Technologies
laratechnologies
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
Atlassian
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Mohammad Hossein Rimaz
 
Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
 
Java to scala
Java to scalaJava to scala
Java to scala
Skills Matter
 
Java Basics
Java BasicsJava Basics
Java Basics
Fahad Shahzad
 
Polyglot Grails
Polyglot GrailsPolyglot Grails
Polyglot Grails
Marcin Gryszko
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
Mike Slinn
 
PALASH SL GUPTA
PALASH SL GUPTAPALASH SL GUPTA
PALASH SL GUPTA
PALASH GUPTA
 
Scala Native: Ahead of Time
Scala Native: Ahead of TimeScala Native: Ahead of Time
Scala Native: Ahead of Time
Nadav Wiener
 
Java introduction by lara technologies
Java introduction by lara technologiesJava introduction by lara technologies
Java introduction by lara technologies
technologieslara
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
Viplav Jain
 
Scala for android
Scala for androidScala for android
Scala for android
Tack Mobile
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
Brent Lemons
 
AWS Lambda How to upload and load gems fast
AWS Lambda How to upload and load gems fastAWS Lambda How to upload and load gems fast
AWS Lambda How to upload and load gems fast
Poznań Ruby User Group
 
Introduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristicsIntroduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristics
rashmishekhar81
 
Experience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaExperience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
John Nestor
 
LSUG: How we (mostly) moved from Java to Scala
LSUG: How we (mostly) moved from Java to ScalaLSUG: How we (mostly) moved from Java to Scala
LSUG: How we (mostly) moved from Java to Scala
Graham Tackley
 
Java to Scala: Why & How
Java to Scala: Why & HowJava to Scala: Why & How
Java to Scala: Why & How
Graham Tackley
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mix
Stefano Galarraga
 
Java basics at Lara Technologies
Java basics at Lara TechnologiesJava basics at Lara Technologies
Java basics at Lara Technologies
laratechnologies
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
Atlassian
 
Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
Mike Slinn
 
Scala Native: Ahead of Time
Scala Native: Ahead of TimeScala Native: Ahead of Time
Scala Native: Ahead of Time
Nadav Wiener
 
Java introduction by lara technologies
Java introduction by lara technologiesJava introduction by lara technologies
Java introduction by lara technologies
technologieslara
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
Viplav Jain
 
Scala for android
Scala for androidScala for android
Scala for android
Tack Mobile
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
Brent Lemons
 
AWS Lambda How to upload and load gems fast
AWS Lambda How to upload and load gems fastAWS Lambda How to upload and load gems fast
AWS Lambda How to upload and load gems fast
Poznań Ruby User Group
 
Introduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristicsIntroduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristics
rashmishekhar81
 
Experience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaExperience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
John Nestor
 

More from GiltTech (9)

Riak a successful failure
Riak   a successful failureRiak   a successful failure
Riak a successful failure
GiltTech
 
Real World Cassandra
Real World CassandraReal World Cassandra
Real World Cassandra
GiltTech
 
Gotszling mogo db-membase
Gotszling mogo db-membaseGotszling mogo db-membase
Gotszling mogo db-membase
GiltTech
 
Couchdb at AMEX
Couchdb at AMEXCouchdb at AMEX
Couchdb at AMEX
GiltTech
 
Scala for the web Lightning Talk
Scala for the web Lightning TalkScala for the web Lightning Talk
Scala for the web Lightning Talk
GiltTech
 
Clojure Lightning Talk
Clojure Lightning TalkClojure Lightning Talk
Clojure Lightning Talk
GiltTech
 
CoffeeScript Lightning Talk
CoffeeScript Lightning TalkCoffeeScript Lightning Talk
CoffeeScript Lightning Talk
GiltTech
 
Erlang Lightning Talk
Erlang Lightning TalkErlang Lightning Talk
Erlang Lightning Talk
GiltTech
 
Groovy and Grails
Groovy and GrailsGroovy and Grails
Groovy and Grails
GiltTech
 
Riak a successful failure
Riak   a successful failureRiak   a successful failure
Riak a successful failure
GiltTech
 
Real World Cassandra
Real World CassandraReal World Cassandra
Real World Cassandra
GiltTech
 
Gotszling mogo db-membase
Gotszling mogo db-membaseGotszling mogo db-membase
Gotszling mogo db-membase
GiltTech
 
Couchdb at AMEX
Couchdb at AMEXCouchdb at AMEX
Couchdb at AMEX
GiltTech
 
Scala for the web Lightning Talk
Scala for the web Lightning TalkScala for the web Lightning Talk
Scala for the web Lightning Talk
GiltTech
 
Clojure Lightning Talk
Clojure Lightning TalkClojure Lightning Talk
Clojure Lightning Talk
GiltTech
 
CoffeeScript Lightning Talk
CoffeeScript Lightning TalkCoffeeScript Lightning Talk
CoffeeScript Lightning Talk
GiltTech
 
Erlang Lightning Talk
Erlang Lightning TalkErlang Lightning Talk
Erlang Lightning Talk
GiltTech
 
Groovy and Grails
Groovy and GrailsGroovy and Grails
Groovy and Grails
GiltTech
 

Recently uploaded (20)

Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 

Java to scala

  • 1. (mostly) How we moved from ^ Java to Scala Graham Tackley guardian.co.uk
  • 2. History • Java shop since 2006 • guardian.co.uk: java + spring + velocity + hibernate + oracle • ~100k lines production java code (and ~35k xml...)
  • 3. Content API • Provide API to access all of our website content • Limited beta released early 2009 • Started implementation of final version late 2009 • Live May 2010: http://content.guardianapis.com
  • 4. Content API (demo of http://content.guardianapis.com)
  • 5. November 2009 • Started new Content API implementation • java + guice + guice servlets + apache solr
  • 6. November 2009 • A few people had played with scala • No production scala code
  • 7. January 2010 • Comprehensive integration tests were very important to us • Started writing our integration tests in Scala with the awesome ScalaTest • Already a maven project, so mixed scala- java support easy with maven-scala-plugin demo: mavan-scala-plugin, ScalaTest
  • 9. January 2010 • A fair bit of our test code was java- without-semicolons as we learnt about Scala...
  • 11. February 2010 • ... despite that we loved it so much that after a month we decided to convert the whole app to Scala • scala + guice + guice servlets + apache solr
  • 12. Our top 5 things we loved about scala on day one
  • 13. 1. Sensible Class Constructors =>
  • 14. 1. Sensible Class Constructors
  • 15. 2. Type inference / val & var ArrayList<String> myList = new ArrayList<String>(); => val myList = new ArrayList[String]
  • 16. 3. No source file naming constraints • Don’t need to be named after package & class name like java • So multiple classes are allowed in a single file e.g. ResponseRenderer.scala
  • 17. 4. REPL (console) • run “scala” for a scala shell • awesome for experimentation
  • 18. 5. Same tools, libs, deployment & runtime characteristics as Java • We still use IntelliJ (with the scala plugin) • A scala war file is just a war file • All the experience of running jvm in production still applies • Can still use java libraries e.g. GuiceServletConfig.scala, XmlFormatter.scala
  • 19. Our top 5 things we loved about scala on day one SUMMARY: Scala is great even if you only use it as a more concise java (java-without-semicolons™); for us this was a great way to start.
  • 20. July 2010 • Switched from maven to simple-build-tool • Mainly for incremental compilation • ~ test-quick and ~ prepare-webapp also invaluable
  • 22. some early code... it took us a while to realise that most of the loops we wrote in Java were actually “map” or “flatMap”
  • 23. ... ended up as it took us a while to realise that most of the loops we wrote in Java were actually “map” or “flatMap”
  • 24. Summary • Migration path from Java relatively smooth • Take it easy, and don’t fear java-without- semicolons in the early days • An incremental embrace of Scala features worked really well for us • Hide the Java yuk with implicit conversions
  • 25. • http://content.guardianapis.com • http://www.guardian.co.uk/open-platform • http://github.com/guardian/open-platform- content-api-scala-client [email protected] ■ @tackers

Editor's Notes