introduction to scala for java developers

Post on 13-Jan-2017

190 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

~ Scala for the impatient Java Developer ~

Meetup By :

9 MARCH 2016

~ Agenda ~

• Why Scala (imperative Vs. functional programming)

• intro to Scala(Basic)

• Quick Demo: Akka actors

~ Why Scala ~

SCALA JAVA

~ Why Scala ~

SCALA JAVA 8

~ Why Scala ~

• Both JVM based

• You can call Scala from Java and vice versa

• Both are OOP but scala also supports functional Programming

Major similarities with Java:

~ Why Scala ~

• Scala reduces number of lines by using type inference

• Learning curve is steep (syntax looks confusing)

• Lazy evaluation: allows to defer time consuming computation, until absolutely needed

Major differences with Java:

~ Why Scala ~

• Functional as well as Object-Oriented

• Scala is compatible with Java

• Scala is compiled to Java byte-codes

• Therefore, Scala runs on JVM

~ A First Example ~

~ Class Hierarchy ~

~ Interaction with Java ~

~ Everything is an Object ~

Numbers are object: means numbers has methods

Functions are also object: you can pass them everywhere as object!

~ Everything is an Object ~

~ Everything is an Object ~

~ Classes ~

~ Case Class ~

~ Case Class ~

~ Pattern Matching ~

~ Pattern Matching ~

~ Traits ~

~ Genericity ~

~ 10 min Break ~

~ Akka ~

• Name comes from Goddess (native swedes) that represents all wisdom and Beauty in the world.

• Also name of beautiful mountain in Laponia, Sweden

~ Akka ~

“Toolkit and runtime for building highly concurrent distributed message-driven applications on the JVM.”~akka.io

~ Akka actor ~

~ Akka actor ~

~ Akka actor ~

Let’s do a demo!

: @5oheyl

Keep in touch:

Contact: joinus@developers.nl

top related