21. Statelessness
● should perform every task as if for the first time
– ignorant of the past
22. Thinking in Functions
● All of your functions must accept at least one
argument
● All of your functions must return data or another
function
● No loops!
23. Multi paradigm Implementations
● Imperative with functional features
– Java, C#, Python, Ruby
● Functional with OO features
– Scala
– Ocaml, f#
What makes difference?
– Higher order functions
– Immutable data structures
– Recommended functional style idioms
26. Why Scala
● Nice functional support
– Basically functional + immutable data structures + ...
● Type inference system
– Less program code, more type checks
● Designed for scalability
● Stick with JVM echo system
27. Scala Features
● Lambda expressions, closures and currying
naturally
● Pattern matching
● Multiple inheritance through Traits
● Comprehensive collections library
32. Functional Programing Issues
● Input/output difficult to deal with
– Monadic operations
● Requires garbage collection
● Sometimes slower (but usually not by much)
● Stateful operations are cumbersome
33. Learn more
● http://www.scala-lang.org/old/node/8610
35. Thread based Model
● Shared mutable state
● Threads concurrently execute code sections
– Synchronization
– Locking mechanism
– Not scalable
– Edward A. Lee, The Problem with Threads
55. Supervision & Resilience
● OneForOneStrategy VS AllForOneStrategy
● Monitor through Death Watch
● Every single actor has a default supervisor
strategy. Which is usually sufficient. But it can
be overridden
56. Scalability & Elasticity
● Scale Up VS Scale Out
– Essentially are same thing
● Minimize Contention
● Maximize Locality of Reference
– Share Nothing Design