SlideShare a Scribd company logo
3 juin 2014 1
Scala and OT
Seeing what is Seen
Leo Bufi Barrameda, Jose Paulo Santiago
May 27, 2014
3 juin 2014 2
• Software Engineer in OT (Oberthur)
• Software Enthusiast
• Working with Scala for 3 years
• Sexiest Programmer (Usually Code wearing
underwear)
About Me
3 juin 2014 3
3 juin 2014 3
3 juin 2014 4
About You Guys
•___ % of Java Developers
•___ % of Ruby Developers
•___ % of PHP Developers
•___ % of .Net Developers
•___ % of Scala Developers
•100% Scala Enthusiast
Java
Ruby
PHP.Net
Scala
Scala Enthusiast
Scala
Developers
June 3, 2014 6
About OT
• The Company
• 1842 – Oberthur Printing Company
• 1984 – Oberthur Technologies
(Secure Printing)
• 2003 – Oberthur Philippines
• 2011 – Acquisition by Advent
International
• Employees
• 6000+ Worldwide
• 200+ in the Philippines
• Customers:
• Telecommunications
• Banks
• Transport
• Governments
• My Personal Experience
• 
Vision: To be the best secure technology company in the world
June 3, 2014 7
About OT – Showcase of Product
June 3, 2014 8
About OT – Showcase of Product in Philippines
3 juin 2014 9
3 juin 2014 10
OT Objectives
• To create a Scalable Applications that can handle millions of transaction per
day.
• To create a multi-tenancy Applications in which every client will have
different procedures and different hardware set up.
• To make a scalable development procedure to scale with the number of
people, number of project.
• Application can run any number of customer on any topology.
3 juin 2014 10
3 juin 2014 11
To Achieve this Goal:
3 juin 2014 12
Scala (SCAlable Language)
• A language that run on JVM
• A programming language that combines the OOP and Functional concepts.
• As an India Guy said, Scala is Java having all the items on the Effective in
Java book + Functional Concepts.
JVM
Converted into ByteCode
SCALA
OOP with Effective in Java ON
Functional Concept
3 juin 2014 13
Why Scala?
• Seamless Java Interop
• Can use the rich existing Java Library.
JVM
SCALA BYTE
CODE
JAVA BYTE
CODE
Calls
Calls
3 juin 2014 14
Seamless Java Interop
• Use Existing Builders like maven and ant
• But why use maven and ant, there is sbt (simple build tool).
• This can use maven repository.
• Don’t use xml, you will use scala to build/define a scala project
object Demo extends Build {
val buildSettings = Defaults.defaultSettings ++ Seq(
organization := "com.demo",
version := "2.0.29",
scalaVersion := "2.9.0-1")
val scalatest = "org.scalatest" % "scalatest_2.9.0" % "1.4.1" % "test"
val commonDeps = Seq(scalatest)
lazy val project = Project(
"demo",
file("."),
settings = buildSettings ++ Seq(libraryDependencies ++= commonDeps))
}
3 juin 2014 15
object BuildSettings { ... }
object Resolvers { ... }
object Dependencies { ...}
object Publishing { ... }
object DemoBuild extends Build {
import BuildSettings._
import Dependencies._
import Publishing._
lazy val root = Project("demo", file("."),
settings =
Project.defaultSettings ++
commonDeps)
.aggregate(subProject1, subProject2)
...
}
3 juin 2014 16
3 juin 2014 17
Why Scala? - Type Inference
• val num = 1 //number is Int
• val hello = "Hello " //helloWorld is String
• Less Boilerplate: Let the type system figure out the type you want.
• Scala is a strongly type language but due to Type Inference it seems not
implicit def makeInteger(value: String) = value.toInt
math.max("500", 200)
implicit class MakeInteger(e: String) {
def makeInteger: Int = e.toInt
}
"500".makeInteger
3 juin 2014 18
Why Scala? - Concurrency and Distribution
• Has Future Support
val compute = future {
Math.PI * 123
}
compute onComplete {
case Success(result) => result
case Failure(exception) => exception
}
3 juin 2014 19
Why Scala? – Future Support
Don’t Wait, REACT!
• Using Future, there will be no non-blocking process. No waiting! What you
need is to REACT once the concrete value/exception is returned.
• Same Principle for Actors/Akka
3 juin 2014 20
Concurrency and Distribution
• Everything is immutable (should be)
• Useful in concurrent applications, can’t be corrupted by thread interference
• All Messages in Akka are immutable (message then to jump from one thread to
other)
• How to use it:
• use val instead of var
• use case class instead of class
3 juin 2014 21
Why Scala? - Traits
• Somewhat similar to interface but can define concrete method definition
• Resolve problem with multiple inheritance by making the evaluation linear.
• Can be use on class instance
3 juin 2014 22
trait Professional {
val name : String
def resume
}
trait SoftwareDev extends Professional {
override def resume = println("Dev : " + name)
}
trait Engineer extends Professional {
override def resume = println("Engineer : " + name)
}
class FreshGraduate(val name: String)
extends SoftwareDev with Engineer
new FreshGraduate("Leiz").resume
//this will print Engineer : Leiz
3 juin 2014 23
Why Scala? – Pattern Matching
• You can make decision construction base on type, value and construct
someValue match {
case Some(s : String) => s
case Some(i : Int) => i
case None => None
case _ =>
}
3 juin 2014 24
Why Scala? – Pattern Matching
• This combine with Partial Function is all awesomeness 
def authenticate: PartialFunction[Any, Any] = {
case Authenticate(user, body) => ....
Body(authorize, body)
}
def body: PartialFunction[Any, Any] = {
case Body(true, body) => //do if authenticated
case Body(false, _) => //do when not authenticated
}
def closeSession: PartialFunction[Any, Any] = {
case Close(user, body) => //process to close the session
Body(successful, body)
}
(authenticate andThen body) orElse (body) orElse (closeSession andThen body)
3 juin 2014 25
Why Scala? – High Order Function
• Function is a first class citizen, you can pass it as parameter, assign it to a
variable etc.
• With this, you can just define behaviour making things more declarative
rather procedural.
def recursion(value: Int, method: Int => Int,
condition: Int => Boolean): Int = condition(value) match {
case true => value
case false => recursion(method(value), method, condition)
}
recursion(0, (i: Int) => i + 7, (i: Int) => i >= 2)
Dispatcher
3 juin 2014 26
Akka
• Very lightweight concurrent entities.
• Immutable Event Driven Model similar to Erlang
• Designing the software is easy: Actor present a Doer or Process Box and
Message as the Intent
ActorRef MailBox
Actor
Invoke Message Put it on the Message Queue
ConsumeMessage
object DemoActor {
def props(magicNumber: Int): Props = Props(new
DemoActor(magicNumber)).withDispatcher("demo-dispatcher")
}
class DemoActor(var magicNumber: Int) extends Actor {
def receive = {
case x: Int =>
magicNumber = magicNumber - 1;
sender ! (x + magicNumber)
}
}
3 juin 2014 28
Why Akka? How we Use it in OT
• Easy Concurrency
• Event/Message-Based Driven System
o Single Execution Flow model
o No Shared mutuble state
o Loose Coupling – behavior is isolated within an actor
o Easy to Test – due to it’s isolated behavior
3 juin 2014 29
Why Akka? How we Use it in OT
• Scaling is easy
• You can scale via configuration
o Dispatchers
demo-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
core-pool-size-min = 2
core-pool-size-factor = 2.0
core-pool-size-max = 5
}
throughput = 5
}
3 juin 2014 30
Why Akka? How we Use it in OT
• Scaling is easy
• Router
/demo-actor {
router = round-robin
nr-of-instances = 100
}
STM
3 juin 2014 31
Why Akka? How we Use it in OT
• Software Transactional Memory (STM)
• Haven’t use it directly, it is wrap in Activate Framework
• Less Database access more interaction to memory. All transaction is commited
first on memory before on database.
Application Memory DiskCommits
Commits
Asyncly
3 juin 2014 32
Things we haven’t explore but will do in the future
• Akka Clustering
• We are ambitious, we want to horizontally scale and do redundancy to achieve
zero downtime.
Any Hardware Platform (OS)
3 juin 2014 33
Docker
• Encapsulate your application, which make it runnable with any hardware
environment configuration
• With this we can have the same set up on our dev laptop with our
production env
Docker
Application/Component
3 juin 2014 34
Docker – Useful Commands
• docker pull <image_name>
• docker pull ubuntu
o This will download an image named ubuntu
• docker run <image_name> <command>
• docker run ubuntu apt-get install -y mysql-server
o You had install a mysql server on your base image, Your change have been kept but
are not yet saved.
• docker commit <container_id> <image_name>
• docker commit 67a8d234328342 ubuntu_mysql
o This will create an image base on the current state of container specified
3 juin 2014 35
Docker – Dockerfile
FROM ubuntu
RUN docker run ubuntu apt-get install -y mysql-server
EXPOSE 3306
ENTRYPOINT service mysql start
3 juin 2014 36
Docker – With This:
• Don’t need any IT person to set up a server just to do component testing
• Component, Integration Testing Automation like Crazy 
Git REPO
JENKINS
BUILD
TEST
PUBLISH
DOCKER
APPLICATION
DATABASE
MOCKS
3 juin 2014 37
How Scala, Akka, Docker help OT achieving their goal:
• Scala
• Concurrency is built-in on the language.
• Less Code due to its functional nature, easier to maintain
• All Procedure can be encapsulated in one unit
• Akka
• Makes you worry more on the BL not on the low level concurrency stuff
• Parallelism built-in on the language
• Scaling thru configuration
• Docker
• Component, Integration test on dev station.
• Easy Deployment and no more it works on my end stuff.
DockerDOCKER
Application
APACHECAMEL/SPRAY
AKKA SYSTEM
STM
Postgress
3 juin 2014 403 juin 2014 40
Seeing What is Seen
✔ Seen by everyone 4/27
Hope you don’t be on the Seen Zone
Scala and OT
We are Hiring!
Manila-HR@oberthur.com

More Related Content

What's hot

Akka Actor presentation
Akka Actor presentationAkka Actor presentation
Akka Actor presentation
Gene Chang
 
Android concurrency
Android concurrencyAndroid concurrency
Android concurrency
Ruslan Novikov
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akka
nartamonov
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
stable|kernel
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
WO Community
 
Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background Tasks
WO Community
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
Anders Göransson
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
Tareque Hossain
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
Rakesh Jha
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
Bill Tulloch
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
Andrei KUCHARAVY
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matter
Skills Matter
 
Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)
Jonas Bonér
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camel
krasserm
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Yakov Fain
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
Yakov Fain
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript Testing
Ran Mizrahi
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafe
Sunghyouk Bae
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
Johan Andrén
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
James Johnson
 

What's hot (20)

Akka Actor presentation
Akka Actor presentationAkka Actor presentation
Akka Actor presentation
 
Android concurrency
Android concurrencyAndroid concurrency
Android concurrency
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akka
 
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor ExtensionsConnect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
Connect.Tech- Enhancing Your Workflow With Xcode Source Editor Extensions
 
Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background Tasks
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matter
 
Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)Building Reactive Systems with Akka (in Java 8 or Scala)
Building Reactive Systems with Akka (in Java 8 or Scala)
 
System Integration with Akka and Apache Camel
System Integration with Akka and Apache CamelSystem Integration with Akka and Apache Camel
System Integration with Akka and Apache Camel
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript Testing
 
Introduction of failsafe
Introduction of failsafeIntroduction of failsafe
Introduction of failsafe
 
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 

Similar to Scalamen and OT

Stackato v6
Stackato v6Stackato v6
Stackato v6
Jonas Brømsø
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
Joonas Westlin
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
Prakash Poudel
 
Letest
LetestLetest
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @Coursera
C4Media
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Manuel Bernhardt
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
Jonas Brømsø
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madison
Terry Bunio
 
CS8392 OOP
CS8392 OOPCS8392 OOP
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
anshunjain
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
sureshkumara29
 
Zure Azure PaaS Zero to Hero - DevOps training day
Zure Azure PaaS Zero to Hero - DevOps training dayZure Azure PaaS Zero to Hero - DevOps training day
Zure Azure PaaS Zero to Hero - DevOps training day
Okko Oulasvirta
 
Selenium Automation at Incapsula
Selenium Automation at IncapsulaSelenium Automation at Incapsula
Selenium Automation at Incapsula
adamcarmi
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basics
LovelitJose
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept it
lokeshpappaka10
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
Mats Bryntse
 
Scala Frustrations
Scala FrustrationsScala Frustrations
Scala Frustrations
takezoe
 
Project Orleans - Actor Model framework
Project Orleans - Actor Model frameworkProject Orleans - Actor Model framework
Project Orleans - Actor Model framework
Neil Mackenzie
 
Scale up your thinking
Scale up your thinkingScale up your thinking
Scale up your thinking
Yardena Meymann
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
Pavel Chunyayev
 

Similar to Scalamen and OT (20)

Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Building a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable FunctionsBuilding a document e-signing workflow with Azure Durable Functions
Building a document e-signing workflow with Azure Durable Functions
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
 
Letest
LetestLetest
Letest
 
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @Coursera
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madison
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Zure Azure PaaS Zero to Hero - DevOps training day
Zure Azure PaaS Zero to Hero - DevOps training dayZure Azure PaaS Zero to Hero - DevOps training day
Zure Azure PaaS Zero to Hero - DevOps training day
 
Selenium Automation at Incapsula
Selenium Automation at IncapsulaSelenium Automation at Incapsula
Selenium Automation at Incapsula
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basics
 
Complete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept itComplete PPT about the Java lokesh kept it
Complete PPT about the Java lokesh kept it
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Scala Frustrations
Scala FrustrationsScala Frustrations
Scala Frustrations
 
Project Orleans - Actor Model framework
Project Orleans - Actor Model frameworkProject Orleans - Actor Model framework
Project Orleans - Actor Model framework
 
Scale up your thinking
Scale up your thinkingScale up your thinking
Scale up your thinking
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 

Recently uploaded

Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Recently uploaded (20)

Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

Scalamen and OT

  • 1. 3 juin 2014 1 Scala and OT Seeing what is Seen Leo Bufi Barrameda, Jose Paulo Santiago May 27, 2014
  • 2. 3 juin 2014 2 • Software Engineer in OT (Oberthur) • Software Enthusiast • Working with Scala for 3 years • Sexiest Programmer (Usually Code wearing underwear) About Me
  • 3. 3 juin 2014 3 3 juin 2014 3
  • 4. 3 juin 2014 4 About You Guys •___ % of Java Developers •___ % of Ruby Developers •___ % of PHP Developers •___ % of .Net Developers •___ % of Scala Developers •100% Scala Enthusiast Java Ruby PHP.Net Scala Scala Enthusiast
  • 6. June 3, 2014 6 About OT • The Company • 1842 – Oberthur Printing Company • 1984 – Oberthur Technologies (Secure Printing) • 2003 – Oberthur Philippines • 2011 – Acquisition by Advent International • Employees • 6000+ Worldwide • 200+ in the Philippines • Customers: • Telecommunications • Banks • Transport • Governments • My Personal Experience •  Vision: To be the best secure technology company in the world
  • 7. June 3, 2014 7 About OT – Showcase of Product
  • 8. June 3, 2014 8 About OT – Showcase of Product in Philippines
  • 10. 3 juin 2014 10 OT Objectives • To create a Scalable Applications that can handle millions of transaction per day. • To create a multi-tenancy Applications in which every client will have different procedures and different hardware set up. • To make a scalable development procedure to scale with the number of people, number of project. • Application can run any number of customer on any topology. 3 juin 2014 10
  • 11. 3 juin 2014 11 To Achieve this Goal:
  • 12. 3 juin 2014 12 Scala (SCAlable Language) • A language that run on JVM • A programming language that combines the OOP and Functional concepts. • As an India Guy said, Scala is Java having all the items on the Effective in Java book + Functional Concepts. JVM Converted into ByteCode SCALA OOP with Effective in Java ON Functional Concept
  • 13. 3 juin 2014 13 Why Scala? • Seamless Java Interop • Can use the rich existing Java Library. JVM SCALA BYTE CODE JAVA BYTE CODE Calls Calls
  • 14. 3 juin 2014 14 Seamless Java Interop • Use Existing Builders like maven and ant • But why use maven and ant, there is sbt (simple build tool). • This can use maven repository. • Don’t use xml, you will use scala to build/define a scala project
  • 15. object Demo extends Build { val buildSettings = Defaults.defaultSettings ++ Seq( organization := "com.demo", version := "2.0.29", scalaVersion := "2.9.0-1") val scalatest = "org.scalatest" % "scalatest_2.9.0" % "1.4.1" % "test" val commonDeps = Seq(scalatest) lazy val project = Project( "demo", file("."), settings = buildSettings ++ Seq(libraryDependencies ++= commonDeps)) } 3 juin 2014 15
  • 16. object BuildSettings { ... } object Resolvers { ... } object Dependencies { ...} object Publishing { ... } object DemoBuild extends Build { import BuildSettings._ import Dependencies._ import Publishing._ lazy val root = Project("demo", file("."), settings = Project.defaultSettings ++ commonDeps) .aggregate(subProject1, subProject2) ... } 3 juin 2014 16
  • 17. 3 juin 2014 17 Why Scala? - Type Inference • val num = 1 //number is Int • val hello = "Hello " //helloWorld is String • Less Boilerplate: Let the type system figure out the type you want. • Scala is a strongly type language but due to Type Inference it seems not implicit def makeInteger(value: String) = value.toInt math.max("500", 200) implicit class MakeInteger(e: String) { def makeInteger: Int = e.toInt } "500".makeInteger
  • 18. 3 juin 2014 18 Why Scala? - Concurrency and Distribution • Has Future Support val compute = future { Math.PI * 123 } compute onComplete { case Success(result) => result case Failure(exception) => exception }
  • 19. 3 juin 2014 19 Why Scala? – Future Support Don’t Wait, REACT! • Using Future, there will be no non-blocking process. No waiting! What you need is to REACT once the concrete value/exception is returned. • Same Principle for Actors/Akka
  • 20. 3 juin 2014 20 Concurrency and Distribution • Everything is immutable (should be) • Useful in concurrent applications, can’t be corrupted by thread interference • All Messages in Akka are immutable (message then to jump from one thread to other) • How to use it: • use val instead of var • use case class instead of class
  • 21. 3 juin 2014 21 Why Scala? - Traits • Somewhat similar to interface but can define concrete method definition • Resolve problem with multiple inheritance by making the evaluation linear. • Can be use on class instance
  • 22. 3 juin 2014 22 trait Professional { val name : String def resume } trait SoftwareDev extends Professional { override def resume = println("Dev : " + name) } trait Engineer extends Professional { override def resume = println("Engineer : " + name) } class FreshGraduate(val name: String) extends SoftwareDev with Engineer new FreshGraduate("Leiz").resume //this will print Engineer : Leiz
  • 23. 3 juin 2014 23 Why Scala? – Pattern Matching • You can make decision construction base on type, value and construct someValue match { case Some(s : String) => s case Some(i : Int) => i case None => None case _ => }
  • 24. 3 juin 2014 24 Why Scala? – Pattern Matching • This combine with Partial Function is all awesomeness  def authenticate: PartialFunction[Any, Any] = { case Authenticate(user, body) => .... Body(authorize, body) } def body: PartialFunction[Any, Any] = { case Body(true, body) => //do if authenticated case Body(false, _) => //do when not authenticated } def closeSession: PartialFunction[Any, Any] = { case Close(user, body) => //process to close the session Body(successful, body) } (authenticate andThen body) orElse (body) orElse (closeSession andThen body)
  • 25. 3 juin 2014 25 Why Scala? – High Order Function • Function is a first class citizen, you can pass it as parameter, assign it to a variable etc. • With this, you can just define behaviour making things more declarative rather procedural. def recursion(value: Int, method: Int => Int, condition: Int => Boolean): Int = condition(value) match { case true => value case false => recursion(method(value), method, condition) } recursion(0, (i: Int) => i + 7, (i: Int) => i >= 2)
  • 26. Dispatcher 3 juin 2014 26 Akka • Very lightweight concurrent entities. • Immutable Event Driven Model similar to Erlang • Designing the software is easy: Actor present a Doer or Process Box and Message as the Intent ActorRef MailBox Actor Invoke Message Put it on the Message Queue ConsumeMessage
  • 27. object DemoActor { def props(magicNumber: Int): Props = Props(new DemoActor(magicNumber)).withDispatcher("demo-dispatcher") } class DemoActor(var magicNumber: Int) extends Actor { def receive = { case x: Int => magicNumber = magicNumber - 1; sender ! (x + magicNumber) } }
  • 28. 3 juin 2014 28 Why Akka? How we Use it in OT • Easy Concurrency • Event/Message-Based Driven System o Single Execution Flow model o No Shared mutuble state o Loose Coupling – behavior is isolated within an actor o Easy to Test – due to it’s isolated behavior
  • 29. 3 juin 2014 29 Why Akka? How we Use it in OT • Scaling is easy • You can scale via configuration o Dispatchers demo-dispatcher { type = Dispatcher executor = "thread-pool-executor" thread-pool-executor { core-pool-size-min = 2 core-pool-size-factor = 2.0 core-pool-size-max = 5 } throughput = 5 }
  • 30. 3 juin 2014 30 Why Akka? How we Use it in OT • Scaling is easy • Router /demo-actor { router = round-robin nr-of-instances = 100 }
  • 31. STM 3 juin 2014 31 Why Akka? How we Use it in OT • Software Transactional Memory (STM) • Haven’t use it directly, it is wrap in Activate Framework • Less Database access more interaction to memory. All transaction is commited first on memory before on database. Application Memory DiskCommits Commits Asyncly
  • 32. 3 juin 2014 32 Things we haven’t explore but will do in the future • Akka Clustering • We are ambitious, we want to horizontally scale and do redundancy to achieve zero downtime.
  • 33. Any Hardware Platform (OS) 3 juin 2014 33 Docker • Encapsulate your application, which make it runnable with any hardware environment configuration • With this we can have the same set up on our dev laptop with our production env Docker Application/Component
  • 34. 3 juin 2014 34 Docker – Useful Commands • docker pull <image_name> • docker pull ubuntu o This will download an image named ubuntu • docker run <image_name> <command> • docker run ubuntu apt-get install -y mysql-server o You had install a mysql server on your base image, Your change have been kept but are not yet saved. • docker commit <container_id> <image_name> • docker commit 67a8d234328342 ubuntu_mysql o This will create an image base on the current state of container specified
  • 35. 3 juin 2014 35 Docker – Dockerfile FROM ubuntu RUN docker run ubuntu apt-get install -y mysql-server EXPOSE 3306 ENTRYPOINT service mysql start
  • 36. 3 juin 2014 36 Docker – With This: • Don’t need any IT person to set up a server just to do component testing • Component, Integration Testing Automation like Crazy  Git REPO JENKINS BUILD TEST PUBLISH DOCKER APPLICATION DATABASE MOCKS
  • 37. 3 juin 2014 37 How Scala, Akka, Docker help OT achieving their goal: • Scala • Concurrency is built-in on the language. • Less Code due to its functional nature, easier to maintain • All Procedure can be encapsulated in one unit • Akka • Makes you worry more on the BL not on the low level concurrency stuff • Parallelism built-in on the language • Scaling thru configuration • Docker • Component, Integration test on dev station. • Easy Deployment and no more it works on my end stuff.
  • 39.
  • 40. 3 juin 2014 403 juin 2014 40 Seeing What is Seen ✔ Seen by everyone 4/27 Hope you don’t be on the Seen Zone Scala and OT We are Hiring! Manila-HR@oberthur.com