SlideShare una empresa de Scribd logo
1 de 75
Descargar para leer sin conexión
Splice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS




       Building Distributed Systems
          in                                         with OpenSplice DDS
       :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



                                                    Angelo Corsaro, Ph.D.
                                                       Chief Technology Officer
                                                               PrismTech
                                                       OMG DDS SIG Co-Chair
                                                    angelo.corsaro@prismtech.com


Splice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                      Type Matters
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                The Type Systems Debate
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ The debate around type Programming Languages Type Systems
   has animated computer scientist over several decades and is far
   from being resolved

‣ New Programming Languages are continuing to appear on both
   sides of the fence

        Statically Typed (ex.)                                                Dynamically Typed (ex.)


                                                F #
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
            Are you a Type-Phobic Type?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Proponents of Dynamically Typed Programming Languages
       advocate against strong typing in favor of reduced verbosity
       and added flexibility


            Yet... Are they so sure that a type system always gets
             between you and what you are trying to achieve?
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
             Strongly-Typed Type-Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Well designed type-systems don’t add unnecessary verbosity to
       your application since use sophisticated inference to derive
       types

   ‣ Allow the detection of many errors at compile time, thus
       improving productivity, code quality and reducing the potential
       for run-time errors

   ‣ Enable the generation of more efficient code
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                              Type Matters in
                                          Distributed Systems
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
Type Systems and Distributed Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ The Type System debate has not spared distributed systems
   ‣ Today we can find different technologies taking different
       approaches: from completely untyped to strongly typed

   ‣ The differences are in this case more complex to organize:
       ‣ Some technologies support only one type, being a string or an array of
          bytes (e.g. AMQP)
       ‣ Other technologies support some predefined types (e.g JMS)
       ‣ Other technologies allow the definition of user-specified types (e.g DDS)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
       Types and Distributed Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                    T3
                               T1
                               T2                                                   T2



                        T3

                        T4
                                                           ?                               T1

                                                                                           T4


                                T1                                                    T1

                                T3                                                    T2



                                                User Defined Types
                                                T1    T2    T3    T4
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
       Types and Distributed Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                    T3
                               T1
                               T2                                                   T2


                                                     Pub/Sub Types
                        T3                                                                 T1
                                                 octect sequence
                        T4                                                                 T4


                                T1                                                    T1

                                T3
                                                 AMQP                                 T2



                                                User Defined Types
                                                T1     T2   T3       T4
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
       Types and Distributed Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                    T3
                               T1
                               T2                                                   T2
                                                 MapMessage

                        T3              ObjectMessage           TextMessage                T1

                        T4                                   StreamMessage                 T4
                                               ByteMessage      Pub/Sub Types
                                T1                                                    T1


                                                   JMS
                                T3                                                    T2
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
       Types and Distributed Systems
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                    T3
                               T1         Pub/Sub Types == User Types!
                               T2                                                   T2

                                              T1         T1
                        T3                                                                 T1
                                                   T2        T3
                        T4                                        T3                       T4
                                                        T4
                                T1                                                    T1


                                                    DDS
                                T3                                                    T2
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                     My Manifesto
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
               My Type-System Manifesto
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Modern Statically typed programming languages are very
       valuable for building scalable, safe, and efficient applications

   ‣ Modern Statically typed middleware systems are very valuable
       for building scalable, safe, and efficient distributed applications
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                   ...Thus
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                           +
                          OpenSplice DDS =
                         The best choice for building
                          safe, efficient, and scalable
                                 distributed systems
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                            Stepping into SCALA
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                       What is Scala
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala (pronounced Skah-lah) stands for “Scalable language”
   ‣ It is a language that carefully and creatively blends Object
       Oriented and Functional constructs into a statically typed
       language with sophisticated type inference

   ‣ Scala targets the JVM and .NET runtime and is 100%
       compatible with Java
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                       Why should you care?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



   ‣ Scala is simple to write, extremely compact and easy to
       understand

   ‣ Scala is strongly typed with a structural type system
   ‣ Scala uses a sophisticated type inference to deduce types
       whenever possible

   ‣ Scala is an extensible language (many construct are build in
       the standard library)

   ‣ Scala makes it easy to design Domain Specific Language
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                            Complex Numbers
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ To explore some of the nice features of Scala, let’s see how
       we might design a Complex number class

   ‣ What we expect to be able to do is all mathematical
       operations between complex numbers as well as scalar
       multiplications and division
       ‣ [(1+i2)+2*(3-i5)*(i4)]/(1+i3)
       ‣ ~(1+i2) [Conjugate]
       ‣ !(3+i4) [Modulo]
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                        Constructor
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



   ‣ Scala allows to implicitly create constructors and attributes
       starting from a simple argument list associated with the class
       declaration




                    class Complex(val re: Float, val im: Float)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                    In Java
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                  public class Complex {

                                  !   private final float re;
                                  !   private final float im;

                                  !   public Complex(float re, float im) {
                                  !   ! this.re = re;
                                  !   ! this.im = im;
                                  !   }

                                  !   public float re() { return re;}

                                  !   public float im() { return im;}
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                               Methods
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Everything in Scala is a method even operators
   ‣ Methods name can be symbols such as *, !, +, etc.


           def + (c: Complex) : Complex = Complex(re + c.re, im + c.im)

 or, taking advantage of type inference....
                   def + (c: Complex) = Complex(re + c.re, im + c.im)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                 In Java...
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                   public Complex add(Complex that) {
                   	 	 return new Complex(this.re() + that.re(),
                                          this.im() + that.im());
                   	 }
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                         As a result...
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                            val result = Complex(1,2) + Complex(2,3)




                            Complex c1 = new Complex(1, 2);
                            Complex c2 = new Complex (3,4);
                            Complex c3 = c1.add(c2);
                    or...
                            Complex c3 = (new Complex(1, 2).add(new Complex (3,4));
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
 Negation and Scalar Multiplication
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ In order to design a Complex class that is well integrated in
     our type system we should be able to support the following
     cases:
     ‣ -(a+ib)
     ‣ c*(a+ib)
     ‣ (a+ib)*c
   ‣ How can we supporting something like -(a+ib) and c*(a+ib)?
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                     Scala Unary Operators
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala allows to define unary operators for the following
       method identifiers +, -, !, ~



                            def unary_-() = Complex(-re, -im)
                            !
                            def unary_!() = Math.sqrt(re*re + im*im)
                            !
                            def unary_~() = Complex(re, -im)

as a result we can write:
                        val result = -Complex(1,2) + ~Complex(2,3)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                Scala Implicit Conversions
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ The expression:
                                        val c3 = 3*Complex(5, 7)

   ‣ Is equivalent to:
                                     val c3 = 3.*(Complex(5, 7))

   ‣ Yet, the method to multiply a Integer to a Complex is not
       present in the Scala Int class

   ‣ What can we do to make the trick?
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                Scala Implicit Conversions
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala does not support Open Classes, thus allowing to add
       new methods to existing classes

   ‣ Yet Scala supports implicit conversions that can be used to
       achieve the same result

   ‣ Lets see how...
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                 Scala Implicit Conversion
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   object Complex {
   	 implicit def floatToReComplex (f: Float) = new ReComplex(f)
   	
   	 implicit def intToReComplex(i : Int) = new ReComplex(i)
   }



   class ReComplex(re: Float) {
   	
   	 def * (that: Complex) = Complex(re*that.re,re*that.im)
   	
   }
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                     The Result is...
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                        val c3 = 3*Complex(5, 7)

             is converted automatically into:

                          val c3 = ReComplex(3).*(Complex(5, 7))
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                             Putting it all together
    :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




class Complex(val re: Float, val im: Float) {
	 	                                                                            // Unary Operators
	 // Binary Operators                                                      	   def unary_-() = Complex(-re, -im)
	 def + (c: Complex) = Complex(re + c.re, im + c.im)                       	   def unary_!() = Math.sqrt(re*re + im*im)
	 def - (c: Complex) = Complex(re - c.re, im - c.im)
                                                                           	   def unary_~() = Complex(re, -im)
                                                                           	
	   def * (f: Float) = Complex(f*re, f*im)	
                                                                           	   // Formatting
	   def * (c: Complex) = Complex((re*c.re) - (im*c.im),
                                                                           	   override def toString() : String = {
                                 ((re*c.im) + (im*c.re)))
                                                                           	   	 if (im > 0) re + "+i" + im
	
                                                                           	   	 else if (im < 0) re + "-i" + (-im)
	   def / (c: Complex) = {
                                                                           	   	 else re.toString
	   	 val d = c.re*c.re + c.im*c.im
	   	 Complex(((re*c.re) + (im + c.im))/d,                                 	   	
              ((im*c.re) - (re*c.im))/d )                                  	   }
	   }                                                                      }
Stepping Into

:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                   Functions,
                                                                                    Closures,
                                                                                   & Currying
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                              Functions
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala has first-class functions
   ‣ Functions can be defined and called, but equally functions can
       be defined as unnamed literals and passed as values



        def inc(x: Int) = x + 1                                     val vinc = (x: Int) => x+1
        inc(5)                                                      vinc(5)

                               Notice once again the uniform access principle
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                       Playing with Functions
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                           val list = List(1,2,3,4,5,6,7,8,9)
                           val g5 = list.filter((x: Int) => x > 5)
                           g5: List[Int] = List(6, 7, 8, 9)


  Or with placeholder syntax

                           val list = List(1,2,3,4,5,6,7,8,9)
                           val g5 = list.filter(_ > 5)
                           g5: List[Int] = List(6, 7, 8, 9)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                               Closures
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::


   ‣ Scala allows you to define functions which include free
       variables meaning variables whose value is not bound to the
       parameter list

   ‣ Free variable are resolved at runtime considering the closure
       of visible variable

   ‣ Example:
         def mean(e : Array[Float]) : Float = {                             def mean(e : Array[Float]) : Float = {
         	 	 var sum = 0.0F                                                 	 	 var sum = 0.0F
         	 	 e.foreach((x: Int) => sum += x)                                	 	 e.foreach(sum += _)
         	 	 return sum/e.length                                            	 	 return sum/e.length
         	 }                                                                	 }
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                               Currying
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



   ‣ Scala provides support for curried functions which are applied
       to multiple argument lists, instead of just one

   ‣ Currying is the mechanism Scala provides for introducing new
       control abstraction

                    def curriedSum(x: Int)(y: Int) = x + y

                    curriedSum(1) {
                      3 +5
                    }
Stepping Into

:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                           Traits
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                     Traits
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala supports single inheritance from classes but can mix-in
       multiple traits

   ‣ A trait is the unit of code reuse for Scala. It encapsulate
       methods and field definitions

   ‣ Traits usually expect a class to implement an abstract method,
       which constitutes the “narrow” interface that allows to
       implement a rich behaviour
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
           Ordered Complex Numbers
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Our complex numbers are not comparable
   ‣ Let’s assume that we wanted to make them comparable, and
       lets supposed that we define the total order as based on the
       module of the complex number

   ‣ How can we implement this behavior?
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                      Ordered Trait
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::


   ‣ The Ordered[T] traits encapsulates the set of methods that
       allow to define a total ordering over a type

   ‣ All the behaviour is defined in terms of an abstract method,
       namely “compare”

   ‣ Classes that mix-in this trait have to implement the “compare”
       method
                            class Complex(val re: Float, val im: Float) extends Ordering[Complex] {
                            def compare(x: Complex, y: Complex) = {
                            	 	 if (x == y) 0
                            	 	 else if (!x > !y) 1
                            	 	 else -1
                            	 }
                             }
Stepping Into

:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                               Type
                                                    parametrization
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                         Type Parametrization
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Scala provides support for type parametrization and makes it
       available for both classes as well as traits
                                           trait    Queue[T] {
                                           	 def    head: T
                                           	 def    tail: Queue[T]
                                           	 def    append(x: T) : Queue[T]
                                           }


   ‣ Scala allows to annotate the parametrized type to control the
       resulting type variance
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                       Type Variance
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ If S <: T is Queue[S] <: Queue[T]?
   ‣ By default Scala makes generic types nonvariant. This
       behaviour can be changed using the following annotations:

   ‣ Queue[+T] indicates that the the sub-typing is covariant in the
       parameter T

   ‣ Queue[-T] indicates that the the sub-typing is contravariant in
       the parameter T
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                            Who is Using Scala
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




 ‣ Scala adoption has been propelled by some user of excellence
     such as:
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                       Stepping into DDS
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                           How Does it Work?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
                                                                                                         as a
                                                                                            c an be seen
                                                                                 Note: DDS               NDA
                                                                                            n  of the LI
                                                                                  relaxatio
                                                                                                       odel
                                                                                     coord ination m

‣ DDS is based around the                                                                                  Brokers
    concept of a fully distributed
    Global Data Space (GDS)
                                                                                            DDS
‣ Applications can autonomously                                                     Global Data Space
    and asynchronously read/
    written data in the GDS
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                          How Does it Work?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                     Publisher                             Brokers   Subscriber

‣ Publishers and
    Subscribers can
                                                                                  DDS
    join and leave the                                                                                Subscriber
                                                    Publisher
    GDS at any time                                                    Global Data Space




                                                      Publisher                                      Subscriber
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                           How Does it Work?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ Publishers and                                     Publisher                             Brokers   Subscriber

    Subscribers express
    their intent to
                                                                                  DDS
    produce/consume                                 Publisher
                                                                                                      Subscriber

    specific type of data,                                             Global Data Space

    e.g., Topics
                                                      Publisher                                      Subscriber
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                           How Does it Work?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                     Publisher                             Brokers   Subscriber
‣ Subscriptions are
    matched by taking
    into account topics                                                           DDS                 Subscriber
    (name, data type and                            Publisher          Global Data Space
    QoS)

                                                      Publisher                                      Subscriber
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                           How Does it Work?
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                     Publisher                             Brokers   Subscriber

‣ Subscriptions are
    dynamically matched                                                           DDS
    and Data flows from                             Publisher
                                                                                                      Subscriber
                                                                       Global Data Space
    Publisher to
    Subscribers
                                                      Publisher                                      Subscriber
Tweeting
                                    with
                          OpenSplice DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                Starting to Tweet
                                               With OpenSplice DDS
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                            A “Tweet” with DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




    Topic:                                                                                 Tweet

    ‣ Unit of information
        exchanged between                                                                  Name

        Publisher and Subscribers.

    ‣ An association between a                                            Type             Topic       QoS

        unique name, a type and a
                                                                                                   {
        QoS setting                                                     TweetType
                                                                                                       Reliable,
                                                                                                       Persistent,
                                                                                                       ...
                                                                                                   }
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                            A “Tweet” with DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   Topic Type:
   ‣ Type describing the data
     associated with one or more
     Topics                                                                  struct TweetType {
                                                                                string   name;
                                                                                string   tweet;
   ‣ A Topic type can have a key                                             };
       represented by an arbitrary                                           #pragma keylist Tweet userId

       number of attributes

   ‣ Expressed in IDL (or XML)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                             Tweeting With DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                       @bird                                                @ocell

‣ Tweeters come...                                                           DDS
                                                           Global Data Space
‣ Tweeters go...                 @oiseau                                                            @lintu




                                       @lind                                               @vogel
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                             Tweeting With DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



                                    {@ocell, @oiseau}




                                       @bird                                                        @ocell

‣ Tweeters follow                                                            DDS
   (subscribe) to                                          Global Data Space
                                 @oiseau                                                                   @lintu
   other tweeters                     {@vogel}                                             {@oiseau, @bird, ocell}




                                       @lind                                                      @vogel
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                             Tweeting With DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



                                    {@ocell, @oiseau}



                                                             @birdTopic               @ocellTopic
‣ Each Tweeter                         @bird                                                             @ocell

   can be                                                          @oiseauTopic
   represented                                                                        @lintuTopic
                                                                                                                @lintu
   with a unique                 @oiseau                       @lindTopic
   topic                              {@vogel}
                                                                                @vogelTopic
                                                                                                {@oiseau, @bird, ocell}




                                       @lind                                                           @vogel
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                          can
              rti  tions
        DS pa


                                  Tweeting With DDS
      D                  ng
Note:        ied  by usi
  be  specif          weeter
                             .*
                 g. t
         rds, e.
 wildca


     :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



                                         {@ocell, @oiseau}

      ‣ ...or each                                               tweeter.bird              tweeter.ocel
         Tweeter can                                             @TweetTopic                @TweetTopic
                                                                                                              @ocell
         be represented                     @bird

         with a unique                                                  @TweetTopic
                                                                      tweeter.oiseau
         partition                                                                         @TweetTopic
                                      @oiseau                                                                        @lintu
                                                                  @TweetTopic             tweeter.lintu
      ‣ All tweeters                       {@vogel}              tweeter.lind                        {@oiseau, @bird, ocell}
         use the same                                                                @TweetTopic
                                                                                     tweeter.vogel
         topic
                                            @lind                                                           @vogel
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                             Tweeting With DDS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::



                                    {@ocell, @oiseau}

‣ ...or all
   Tweeters use
                                                                                                    @ocell
   the same topic                      @bird


‣ Content                                                                 @TweetTopic

   filtering or                  @oiseau                                                                   @lintu
   queries are                        {@vogel}                                             {@oiseau, @bird, ocell}
   used to extract
   relevant data
                                       @lind                                                      @vogel
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                             Who is Using DDS
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                 Some Use Cases
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::


Defense & Aerospace
‣ Naval Combat Management Systems
‣   Submarines
‣   Vetronics
‣   Tactical Links
‣   Simulation
‣   Cybercrime
‣   Flycatcher Systems
‣   Data Fusion
‣   Battle Transformation Center
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                 Some Use Cases
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::

 Transportation
 ‣ Drones
 ‣ Air Traffic Control & Management
 ‣ Metropolitan Transportation


 Financial Services
 ‣ Automated Trading Firms
 ‣ Risk Management Firms
OpenSplice DDS
Delivering Performance, Openness, and Freedom

 :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                      Scala and DDS
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                           The Escalier Project
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ A new OpenSplice DDS technology
   incubator recently launched to
   develop a Scala binding for                                              Escalier
   OpenSplice DDS
                                                                                http://code.google.com/p/escalier/
‣ The Scala Binding is being
   developed by enhancing the current
   Java Binding

‣ Project hosted on google code first
   public release by the end of June
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                 Twitting
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                                 Twitting
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                Pick your “write”
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ We can also write as:
  writer.write(tweet)                                  =>           writer write tweet
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                Pick your “write”
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ Or if we want to let treat a writer like an actor:
                                         writer ! tweet
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                Pick your “write”
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ And if we have a lot to tweet:
                        writer ! (tweet1, tweet2, ..., tweetn)
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                        Twits Reader
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                 Pick your “read”
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




‣ We can also write as:
val data = reader.read() =>                                            val data = reader read
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                 Pick your “read”
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ Or we can be a bit more functional...:

       reader forEach((t: Tweet) => println(t.name + “: “ + t.msg))
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                         Setting QoS
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   Example
   ‣ Setting Durability and History on the TopicQos
  val qos = TopicQos() <= PersistentDurability() <= KeepLastHistory(tweetHistory)

  val topic = Topic[Tweet](“Tweet”, qos, pub)
Stepping Into

:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                                    Demo Time
OpenSplice DDS
             The Universal Data Bus
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




                                                                            Summing-Up
                                                                                   +/-*
OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD
                                        Summing Up
:: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::




   ‣ A good type system can help in the development of both
       traditional and distributed applications, as it improves code
       quality, productivity, safety and runtime efficiency

   ‣ Scala and OpenSplice DDS are a very powerful combination
       since provide scalable language and middleware mechanism
       for building large scale complex distributed systems
OpenSplice DDS
             Delivering Performance, Openness, and Freedom


                http://www.opensplice.com/
References
               http://www.opensplice.org/                    http://www.slideshare.net/angelo.corsaro
                emailto:opensplicedds@prismtech.com




                http://bit.ly/1Sreg
                                                             http://twitter.com/acorsaro/




                http://www.youtube.com/OpenSpliceTube        http://opensplice.blogspot.com

Más contenido relacionado

Destacado

Elvis Presley
Elvis PresleyElvis Presley
Elvis Presleyhelenavf1
 
Carteles art nouveau redux
Carteles art nouveau reduxCarteles art nouveau redux
Carteles art nouveau reduxalmudenaresad
 
Kamloops.#2.nov.2012
Kamloops.#2.nov.2012Kamloops.#2.nov.2012
Kamloops.#2.nov.2012Faye Brownlie
 
Asia Food 6B
Asia Food 6BAsia Food 6B
Asia Food 6BC FM
 
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicas
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicasLos primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicas
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicasPepe Jara Cueva
 
Sunshine coast admin
Sunshine coast adminSunshine coast admin
Sunshine coast adminFaye Brownlie
 
Castañada infantil 2012
Castañada infantil 2012Castañada infantil 2012
Castañada infantil 2012XXX XXX
 
Gitified by valentin bora
Gitified by valentin boraGitified by valentin bora
Gitified by valentin boraValentin Bora
 
Orange Language Travel Hero
Orange Language Travel   HeroOrange Language Travel   Hero
Orange Language Travel HeroOrange BG
 
Pipeline 4 Progress Action Plan Summary
Pipeline 4 Progress Action Plan SummaryPipeline 4 Progress Action Plan Summary
Pipeline 4 Progress Action Plan SummaryCreAgent Marketing
 
Cbi Revenue Recognition Panel Slides 031709 Final
Cbi Revenue Recognition Panel Slides 031709 FinalCbi Revenue Recognition Panel Slides 031709 Final
Cbi Revenue Recognition Panel Slides 031709 Finalthess1121
 
Finlandia 2009 [Autoguardado]
Finlandia 2009 [Autoguardado]Finlandia 2009 [Autoguardado]
Finlandia 2009 [Autoguardado]guestd4e08
 
Portfolio Daniel Pedrosa
Portfolio Daniel PedrosaPortfolio Daniel Pedrosa
Portfolio Daniel Pedrosaguest90db5e
 
Focus 2 - Principii de psihologie aplicata in software
Focus 2 - Principii de psihologie aplicata in softwareFocus 2 - Principii de psihologie aplicata in software
Focus 2 - Principii de psihologie aplicata in softwareValentin Bora
 
Euro Style Design Ltd The Designs
Euro Style Design Ltd The DesignsEuro Style Design Ltd The Designs
Euro Style Design Ltd The DesignsRoland Laufer
 

Destacado (18)

Elvis Presley
Elvis PresleyElvis Presley
Elvis Presley
 
Carteles art nouveau redux
Carteles art nouveau reduxCarteles art nouveau redux
Carteles art nouveau redux
 
Kamloops.#2.nov.2012
Kamloops.#2.nov.2012Kamloops.#2.nov.2012
Kamloops.#2.nov.2012
 
Asia Food 6B
Asia Food 6BAsia Food 6B
Asia Food 6B
 
isd312-05-wordnet
isd312-05-wordnetisd312-05-wordnet
isd312-05-wordnet
 
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicas
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicasLos primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicas
Los primeros años_el_bienestar_infantil_y_el_papel_de_las_políticas_públicas
 
Sunshine coast admin
Sunshine coast adminSunshine coast admin
Sunshine coast admin
 
Marca personal
Marca personalMarca personal
Marca personal
 
Castañada infantil 2012
Castañada infantil 2012Castañada infantil 2012
Castañada infantil 2012
 
Gitified by valentin bora
Gitified by valentin boraGitified by valentin bora
Gitified by valentin bora
 
Orange Language Travel Hero
Orange Language Travel   HeroOrange Language Travel   Hero
Orange Language Travel Hero
 
Pipeline 4 Progress Action Plan Summary
Pipeline 4 Progress Action Plan SummaryPipeline 4 Progress Action Plan Summary
Pipeline 4 Progress Action Plan Summary
 
Cbi Revenue Recognition Panel Slides 031709 Final
Cbi Revenue Recognition Panel Slides 031709 FinalCbi Revenue Recognition Panel Slides 031709 Final
Cbi Revenue Recognition Panel Slides 031709 Final
 
ikp213-06-horn-clause
ikp213-06-horn-clauseikp213-06-horn-clause
ikp213-06-horn-clause
 
Finlandia 2009 [Autoguardado]
Finlandia 2009 [Autoguardado]Finlandia 2009 [Autoguardado]
Finlandia 2009 [Autoguardado]
 
Portfolio Daniel Pedrosa
Portfolio Daniel PedrosaPortfolio Daniel Pedrosa
Portfolio Daniel Pedrosa
 
Focus 2 - Principii de psihologie aplicata in software
Focus 2 - Principii de psihologie aplicata in softwareFocus 2 - Principii de psihologie aplicata in software
Focus 2 - Principii de psihologie aplicata in software
 
Euro Style Design Ltd The Designs
Euro Style Design Ltd The DesignsEuro Style Design Ltd The Designs
Euro Style Design Ltd The Designs
 

Similar a Building Distributed Systems in Scala with OpenSplice DDS

Tweeting with OpenSplice DDS
Tweeting with OpenSplice DDSTweeting with OpenSplice DDS
Tweeting with OpenSplice DDSAngelo Corsaro
 
Open splicedds espercep-webinar
Open splicedds espercep-webinarOpen splicedds espercep-webinar
Open splicedds espercep-webinarTomasz Waszczyk
 
FIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopFIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopPaul Filkin
 
T3Flex
T3FlexT3Flex
T3FlexKosack
 
DDS Efficiency and Extensibility
DDS Efficiency and ExtensibilityDDS Efficiency and Extensibility
DDS Efficiency and ExtensibilityAngelo Corsaro
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudsparkfabrik
 
I just want to publish my services 🙀
I just want to publish my services 🙀I just want to publish my services 🙀
I just want to publish my services 🙀Sergio Matone
 
Stream Processing with DDS and CEP
Stream Processing with  DDS and CEPStream Processing with  DDS and CEP
Stream Processing with DDS and CEPAngelo Corsaro
 
A Lightweight Formal Encoding for a Constraint Language DSML Component
A Lightweight Formal Encoding for a Constraint Language DSML ComponentA Lightweight Formal Encoding for a Constraint Language DSML Component
A Lightweight Formal Encoding for a Constraint Language DSML ComponentMarc Pantel
 
DotDotPwn v3.0 [GuadalajaraCON 2012]
DotDotPwn v3.0 [GuadalajaraCON 2012]DotDotPwn v3.0 [GuadalajaraCON 2012]
DotDotPwn v3.0 [GuadalajaraCON 2012]Websec México, S.C.
 
Tron token development services
Tron token development servicesTron token development services
Tron token development servicesAmniAugustine
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_FinalSam Knutson
 

Similar a Building Distributed Systems in Scala with OpenSplice DDS (20)

Tweeting with OpenSplice DDS
Tweeting with OpenSplice DDSTweeting with OpenSplice DDS
Tweeting with OpenSplice DDS
 
Cloudand Xchange
Cloudand XchangeCloudand Xchange
Cloudand Xchange
 
Open splicedds espercep-webinar
Open splicedds espercep-webinarOpen splicedds espercep-webinar
Open splicedds espercep-webinar
 
FIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopFIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools Workshop
 
SimD
SimDSimD
SimD
 
T3Flex
T3FlexT3Flex
T3Flex
 
DDS Efficiency and Extensibility
DDS Efficiency and ExtensibilityDDS Efficiency and Extensibility
DDS Efficiency and Extensibility
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloud
 
I just want to publish my services 🙀
I just want to publish my services 🙀I just want to publish my services 🙀
I just want to publish my services 🙀
 
Stream Processing with DDS and CEP
Stream Processing with  DDS and CEPStream Processing with  DDS and CEP
Stream Processing with DDS and CEP
 
TorCoin_slides
TorCoin_slidesTorCoin_slides
TorCoin_slides
 
Protocol Tokens 2.0
Protocol Tokens 2.0Protocol Tokens 2.0
Protocol Tokens 2.0
 
A Lightweight Formal Encoding for a Constraint Language DSML Component
A Lightweight Formal Encoding for a Constraint Language DSML ComponentA Lightweight Formal Encoding for a Constraint Language DSML Component
A Lightweight Formal Encoding for a Constraint Language DSML Component
 
eCTD
eCTDeCTD
eCTD
 
Guadalajara con 2012
Guadalajara con 2012Guadalajara con 2012
Guadalajara con 2012
 
DotDotPwn v3.0 [GuadalajaraCON 2012]
DotDotPwn v3.0 [GuadalajaraCON 2012]DotDotPwn v3.0 [GuadalajaraCON 2012]
DotDotPwn v3.0 [GuadalajaraCON 2012]
 
Tron token development services
Tron token development servicesTron token development services
Tron token development services
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_Final
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 

Más de Angelo Corsaro

zenoh: The Edge Data Fabric
zenoh: The Edge Data Fabriczenoh: The Edge Data Fabric
zenoh: The Edge Data FabricAngelo Corsaro
 
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair MonetisationData Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair MonetisationAngelo Corsaro
 
zenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query computezenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query computeAngelo Corsaro
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolAngelo Corsaro
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolAngelo Corsaro
 
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog ComputingBreaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog ComputingAngelo Corsaro
 
fog05: The Fog Computing Infrastructure
fog05: The Fog Computing Infrastructurefog05: The Fog Computing Infrastructure
fog05: The Fog Computing InfrastructureAngelo Corsaro
 
Cyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT AgeCyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT AgeAngelo Corsaro
 
fog05: The Fog Computing Platform
fog05: The Fog Computing Platformfog05: The Fog Computing Platform
fog05: The Fog Computing PlatformAngelo Corsaro
 
Programming in Scala - Lecture Four
Programming in Scala - Lecture FourProgramming in Scala - Lecture Four
Programming in Scala - Lecture FourAngelo Corsaro
 
Programming in Scala - Lecture Three
Programming in Scala - Lecture ThreeProgramming in Scala - Lecture Three
Programming in Scala - Lecture ThreeAngelo Corsaro
 
Programming in Scala - Lecture Two
Programming in Scala - Lecture TwoProgramming in Scala - Lecture Two
Programming in Scala - Lecture TwoAngelo Corsaro
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture OneAngelo Corsaro
 
Data Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained EnvionrmentsData Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained EnvionrmentsAngelo Corsaro
 
The DDS Security Standard
The DDS Security StandardThe DDS Security Standard
The DDS Security StandardAngelo Corsaro
 
The Data Distribution Service
The Data Distribution ServiceThe Data Distribution Service
The Data Distribution ServiceAngelo Corsaro
 
RUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming RuminationsRUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming RuminationsAngelo Corsaro
 

Más de Angelo Corsaro (20)

Zenoh: The Genesis
Zenoh: The GenesisZenoh: The Genesis
Zenoh: The Genesis
 
zenoh: The Edge Data Fabric
zenoh: The Edge Data Fabriczenoh: The Edge Data Fabric
zenoh: The Edge Data Fabric
 
Zenoh Tutorial
Zenoh TutorialZenoh Tutorial
Zenoh Tutorial
 
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair MonetisationData Decentralisation: Efficiency, Privacy and Fair Monetisation
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
 
zenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query computezenoh: zero overhead pub/sub store/query compute
zenoh: zero overhead pub/sub store/query compute
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocol
 
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocolzenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocol
 
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog ComputingBreaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
 
Eastern Sicily
Eastern SicilyEastern Sicily
Eastern Sicily
 
fog05: The Fog Computing Infrastructure
fog05: The Fog Computing Infrastructurefog05: The Fog Computing Infrastructure
fog05: The Fog Computing Infrastructure
 
Cyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT AgeCyclone DDS: Sharing Data in the IoT Age
Cyclone DDS: Sharing Data in the IoT Age
 
fog05: The Fog Computing Platform
fog05: The Fog Computing Platformfog05: The Fog Computing Platform
fog05: The Fog Computing Platform
 
Programming in Scala - Lecture Four
Programming in Scala - Lecture FourProgramming in Scala - Lecture Four
Programming in Scala - Lecture Four
 
Programming in Scala - Lecture Three
Programming in Scala - Lecture ThreeProgramming in Scala - Lecture Three
Programming in Scala - Lecture Three
 
Programming in Scala - Lecture Two
Programming in Scala - Lecture TwoProgramming in Scala - Lecture Two
Programming in Scala - Lecture Two
 
Programming in Scala - Lecture One
Programming in Scala - Lecture OneProgramming in Scala - Lecture One
Programming in Scala - Lecture One
 
Data Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained EnvionrmentsData Sharing in Extremely Resource Constrained Envionrments
Data Sharing in Extremely Resource Constrained Envionrments
 
The DDS Security Standard
The DDS Security StandardThe DDS Security Standard
The DDS Security Standard
 
The Data Distribution Service
The Data Distribution ServiceThe Data Distribution Service
The Data Distribution Service
 
RUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming RuminationsRUSTing -- Partially Ordered Rust Programming Ruminations
RUSTing -- Partially Ordered Rust Programming Ruminations
 

Último

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Último (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

Building Distributed Systems in Scala with OpenSplice DDS

  • 1. Splice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS Building Distributed Systems in with OpenSplice DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Angelo Corsaro, Ph.D. Chief Technology Officer PrismTech OMG DDS SIG Co-Chair angelo.corsaro@prismtech.com Splice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS
  • 2. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Type Matters
  • 3. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD The Type Systems Debate :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ The debate around type Programming Languages Type Systems has animated computer scientist over several decades and is far from being resolved ‣ New Programming Languages are continuing to appear on both sides of the fence Statically Typed (ex.) Dynamically Typed (ex.) F #
  • 4. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Are you a Type-Phobic Type? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Proponents of Dynamically Typed Programming Languages advocate against strong typing in favor of reduced verbosity and added flexibility Yet... Are they so sure that a type system always gets between you and what you are trying to achieve?
  • 5. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Strongly-Typed Type-Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Well designed type-systems don’t add unnecessary verbosity to your application since use sophisticated inference to derive types ‣ Allow the detection of many errors at compile time, thus improving productivity, code quality and reducing the potential for run-time errors ‣ Enable the generation of more efficient code
  • 6. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Type Matters in Distributed Systems
  • 7. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Type Systems and Distributed Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ The Type System debate has not spared distributed systems ‣ Today we can find different technologies taking different approaches: from completely untyped to strongly typed ‣ The differences are in this case more complex to organize: ‣ Some technologies support only one type, being a string or an array of bytes (e.g. AMQP) ‣ Other technologies support some predefined types (e.g JMS) ‣ Other technologies allow the definition of user-specified types (e.g DDS)
  • 8. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Types and Distributed Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: T3 T1 T2 T2 T3 T4 ? T1 T4 T1 T1 T3 T2 User Defined Types T1 T2 T3 T4
  • 9. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Types and Distributed Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: T3 T1 T2 T2 Pub/Sub Types T3 T1 octect sequence T4 T4 T1 T1 T3 AMQP T2 User Defined Types T1 T2 T3 T4
  • 10. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Types and Distributed Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: T3 T1 T2 T2 MapMessage T3 ObjectMessage TextMessage T1 T4 StreamMessage T4 ByteMessage Pub/Sub Types T1 T1 JMS T3 T2
  • 11. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Types and Distributed Systems :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: T3 T1 Pub/Sub Types == User Types! T2 T2 T1 T1 T3 T1 T2 T3 T4 T3 T4 T4 T1 T1 DDS T3 T2
  • 12. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: My Manifesto
  • 13. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD My Type-System Manifesto :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Modern Statically typed programming languages are very valuable for building scalable, safe, and efficient applications ‣ Modern Statically typed middleware systems are very valuable for building scalable, safe, and efficient distributed applications
  • 14. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD ...Thus :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: + OpenSplice DDS = The best choice for building safe, efficient, and scalable distributed systems
  • 15. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Stepping into SCALA
  • 16. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD What is Scala :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala (pronounced Skah-lah) stands for “Scalable language” ‣ It is a language that carefully and creatively blends Object Oriented and Functional constructs into a statically typed language with sophisticated type inference ‣ Scala targets the JVM and .NET runtime and is 100% compatible with Java
  • 17. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Why should you care? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala is simple to write, extremely compact and easy to understand ‣ Scala is strongly typed with a structural type system ‣ Scala uses a sophisticated type inference to deduce types whenever possible ‣ Scala is an extensible language (many construct are build in the standard library) ‣ Scala makes it easy to design Domain Specific Language
  • 18. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Complex Numbers :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ To explore some of the nice features of Scala, let’s see how we might design a Complex number class ‣ What we expect to be able to do is all mathematical operations between complex numbers as well as scalar multiplications and division ‣ [(1+i2)+2*(3-i5)*(i4)]/(1+i3) ‣ ~(1+i2) [Conjugate] ‣ !(3+i4) [Modulo]
  • 19. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Constructor :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala allows to implicitly create constructors and attributes starting from a simple argument list associated with the class declaration class Complex(val re: Float, val im: Float)
  • 20. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD In Java :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: public class Complex { ! private final float re; ! private final float im; ! public Complex(float re, float im) { ! ! this.re = re; ! ! this.im = im; ! } ! public float re() { return re;} ! public float im() { return im;}
  • 21. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Methods :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Everything in Scala is a method even operators ‣ Methods name can be symbols such as *, !, +, etc. def + (c: Complex) : Complex = Complex(re + c.re, im + c.im) or, taking advantage of type inference.... def + (c: Complex) = Complex(re + c.re, im + c.im)
  • 22. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD In Java... :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: public Complex add(Complex that) { return new Complex(this.re() + that.re(), this.im() + that.im()); }
  • 23. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD As a result... :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: val result = Complex(1,2) + Complex(2,3) Complex c1 = new Complex(1, 2); Complex c2 = new Complex (3,4); Complex c3 = c1.add(c2); or... Complex c3 = (new Complex(1, 2).add(new Complex (3,4));
  • 24. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Negation and Scalar Multiplication :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ In order to design a Complex class that is well integrated in our type system we should be able to support the following cases: ‣ -(a+ib) ‣ c*(a+ib) ‣ (a+ib)*c ‣ How can we supporting something like -(a+ib) and c*(a+ib)?
  • 25. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Scala Unary Operators :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala allows to define unary operators for the following method identifiers +, -, !, ~ def unary_-() = Complex(-re, -im) ! def unary_!() = Math.sqrt(re*re + im*im) ! def unary_~() = Complex(re, -im) as a result we can write: val result = -Complex(1,2) + ~Complex(2,3)
  • 26. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Scala Implicit Conversions :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ The expression: val c3 = 3*Complex(5, 7) ‣ Is equivalent to: val c3 = 3.*(Complex(5, 7)) ‣ Yet, the method to multiply a Integer to a Complex is not present in the Scala Int class ‣ What can we do to make the trick?
  • 27. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Scala Implicit Conversions :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala does not support Open Classes, thus allowing to add new methods to existing classes ‣ Yet Scala supports implicit conversions that can be used to achieve the same result ‣ Lets see how...
  • 28. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Scala Implicit Conversion :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: object Complex { implicit def floatToReComplex (f: Float) = new ReComplex(f) implicit def intToReComplex(i : Int) = new ReComplex(i) } class ReComplex(re: Float) { def * (that: Complex) = Complex(re*that.re,re*that.im) }
  • 29. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD The Result is... :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: val c3 = 3*Complex(5, 7) is converted automatically into: val c3 = ReComplex(3).*(Complex(5, 7))
  • 30. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Putting it all together :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: class Complex(val re: Float, val im: Float) { // Unary Operators // Binary Operators def unary_-() = Complex(-re, -im) def + (c: Complex) = Complex(re + c.re, im + c.im) def unary_!() = Math.sqrt(re*re + im*im) def - (c: Complex) = Complex(re - c.re, im - c.im) def unary_~() = Complex(re, -im) def * (f: Float) = Complex(f*re, f*im) // Formatting def * (c: Complex) = Complex((re*c.re) - (im*c.im), override def toString() : String = { ((re*c.im) + (im*c.re))) if (im > 0) re + "+i" + im else if (im < 0) re + "-i" + (-im) def / (c: Complex) = { else re.toString val d = c.re*c.re + c.im*c.im Complex(((re*c.re) + (im + c.im))/d, ((im*c.re) - (re*c.im))/d ) } } }
  • 31. Stepping Into :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Functions, Closures, & Currying
  • 32. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Functions :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala has first-class functions ‣ Functions can be defined and called, but equally functions can be defined as unnamed literals and passed as values def inc(x: Int) = x + 1 val vinc = (x: Int) => x+1 inc(5) vinc(5) Notice once again the uniform access principle
  • 33. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Playing with Functions :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: val list = List(1,2,3,4,5,6,7,8,9) val g5 = list.filter((x: Int) => x > 5) g5: List[Int] = List(6, 7, 8, 9) Or with placeholder syntax val list = List(1,2,3,4,5,6,7,8,9) val g5 = list.filter(_ > 5) g5: List[Int] = List(6, 7, 8, 9)
  • 34. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Closures :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala allows you to define functions which include free variables meaning variables whose value is not bound to the parameter list ‣ Free variable are resolved at runtime considering the closure of visible variable ‣ Example: def mean(e : Array[Float]) : Float = { def mean(e : Array[Float]) : Float = { var sum = 0.0F var sum = 0.0F e.foreach((x: Int) => sum += x) e.foreach(sum += _) return sum/e.length return sum/e.length } }
  • 35. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Currying :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala provides support for curried functions which are applied to multiple argument lists, instead of just one ‣ Currying is the mechanism Scala provides for introducing new control abstraction def curriedSum(x: Int)(y: Int) = x + y curriedSum(1) { 3 +5 }
  • 36. Stepping Into :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Traits
  • 37. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Traits :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala supports single inheritance from classes but can mix-in multiple traits ‣ A trait is the unit of code reuse for Scala. It encapsulate methods and field definitions ‣ Traits usually expect a class to implement an abstract method, which constitutes the “narrow” interface that allows to implement a rich behaviour
  • 38. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Ordered Complex Numbers :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Our complex numbers are not comparable ‣ Let’s assume that we wanted to make them comparable, and lets supposed that we define the total order as based on the module of the complex number ‣ How can we implement this behavior?
  • 39. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Ordered Trait :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ The Ordered[T] traits encapsulates the set of methods that allow to define a total ordering over a type ‣ All the behaviour is defined in terms of an abstract method, namely “compare” ‣ Classes that mix-in this trait have to implement the “compare” method class Complex(val re: Float, val im: Float) extends Ordering[Complex] { def compare(x: Complex, y: Complex) = { if (x == y) 0 else if (!x > !y) 1 else -1 } }
  • 40. Stepping Into :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Type parametrization
  • 41. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Type Parametrization :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala provides support for type parametrization and makes it available for both classes as well as traits trait Queue[T] { def head: T def tail: Queue[T] def append(x: T) : Queue[T] } ‣ Scala allows to annotate the parametrized type to control the resulting type variance
  • 42. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Type Variance :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ If S <: T is Queue[S] <: Queue[T]? ‣ By default Scala makes generic types nonvariant. This behaviour can be changed using the following annotations: ‣ Queue[+T] indicates that the the sub-typing is covariant in the parameter T ‣ Queue[-T] indicates that the the sub-typing is contravariant in the parameter T
  • 43. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Who is Using Scala :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Scala adoption has been propelled by some user of excellence such as:
  • 44. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Stepping into DDS
  • 45. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD How Does it Work? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: as a c an be seen Note: DDS NDA n of the LI relaxatio odel coord ination m ‣ DDS is based around the Brokers concept of a fully distributed Global Data Space (GDS) DDS ‣ Applications can autonomously Global Data Space and asynchronously read/ written data in the GDS
  • 46. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD How Does it Work? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Publisher Brokers Subscriber ‣ Publishers and Subscribers can DDS join and leave the Subscriber Publisher GDS at any time Global Data Space Publisher Subscriber
  • 47. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD How Does it Work? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Publishers and Publisher Brokers Subscriber Subscribers express their intent to DDS produce/consume Publisher Subscriber specific type of data, Global Data Space e.g., Topics Publisher Subscriber
  • 48. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD How Does it Work? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Publisher Brokers Subscriber ‣ Subscriptions are matched by taking into account topics DDS Subscriber (name, data type and Publisher Global Data Space QoS) Publisher Subscriber
  • 49. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD How Does it Work? :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Publisher Brokers Subscriber ‣ Subscriptions are dynamically matched DDS and Data flows from Publisher Subscriber Global Data Space Publisher to Subscribers Publisher Subscriber
  • 50. Tweeting with OpenSplice DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Starting to Tweet With OpenSplice DDS
  • 51. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD A “Tweet” with DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Topic: Tweet ‣ Unit of information exchanged between Name Publisher and Subscribers. ‣ An association between a Type Topic QoS unique name, a type and a { QoS setting TweetType Reliable, Persistent, ... }
  • 52. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD A “Tweet” with DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Topic Type: ‣ Type describing the data associated with one or more Topics struct TweetType { string name; string tweet; ‣ A Topic type can have a key }; represented by an arbitrary #pragma keylist Tweet userId number of attributes ‣ Expressed in IDL (or XML)
  • 53. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Tweeting With DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: @bird @ocell ‣ Tweeters come... DDS Global Data Space ‣ Tweeters go... @oiseau @lintu @lind @vogel
  • 54. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Tweeting With DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: {@ocell, @oiseau} @bird @ocell ‣ Tweeters follow DDS (subscribe) to Global Data Space @oiseau @lintu other tweeters {@vogel} {@oiseau, @bird, ocell} @lind @vogel
  • 55. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Tweeting With DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: {@ocell, @oiseau} @birdTopic @ocellTopic ‣ Each Tweeter @bird @ocell can be @oiseauTopic represented @lintuTopic @lintu with a unique @oiseau @lindTopic topic {@vogel} @vogelTopic {@oiseau, @bird, ocell} @lind @vogel
  • 56. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD can rti tions DS pa Tweeting With DDS D ng Note: ied by usi be specif weeter .* g. t rds, e. wildca :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: {@ocell, @oiseau} ‣ ...or each tweeter.bird tweeter.ocel Tweeter can @TweetTopic @TweetTopic @ocell be represented @bird with a unique @TweetTopic tweeter.oiseau partition @TweetTopic @oiseau @lintu @TweetTopic tweeter.lintu ‣ All tweeters {@vogel} tweeter.lind {@oiseau, @bird, ocell} use the same @TweetTopic tweeter.vogel topic @lind @vogel
  • 57. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Tweeting With DDS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: {@ocell, @oiseau} ‣ ...or all Tweeters use @ocell the same topic @bird ‣ Content @TweetTopic filtering or @oiseau @lintu queries are {@vogel} {@oiseau, @bird, ocell} used to extract relevant data @lind @vogel
  • 58. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Who is Using DDS
  • 59. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Some Use Cases :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Defense & Aerospace ‣ Naval Combat Management Systems ‣ Submarines ‣ Vetronics ‣ Tactical Links ‣ Simulation ‣ Cybercrime ‣ Flycatcher Systems ‣ Data Fusion ‣ Battle Transformation Center
  • 60. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Some Use Cases :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Transportation ‣ Drones ‣ Air Traffic Control & Management ‣ Metropolitan Transportation Financial Services ‣ Automated Trading Firms ‣ Risk Management Firms
  • 61. OpenSplice DDS Delivering Performance, Openness, and Freedom :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Scala and DDS
  • 62. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD The Escalier Project :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ A new OpenSplice DDS technology incubator recently launched to develop a Scala binding for Escalier OpenSplice DDS http://code.google.com/p/escalier/ ‣ The Scala Binding is being developed by enhancing the current Java Binding ‣ Project hosted on google code first public release by the end of June
  • 63. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Twitting :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
  • 64. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Twitting :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
  • 65. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Pick your “write” :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ We can also write as: writer.write(tweet) => writer write tweet
  • 66. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Pick your “write” :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Or if we want to let treat a writer like an actor: writer ! tweet
  • 67. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Pick your “write” :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ And if we have a lot to tweet: writer ! (tweet1, tweet2, ..., tweetn)
  • 68. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Twits Reader :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com ::
  • 69. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Pick your “read” :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ We can also write as: val data = reader.read() => val data = reader read
  • 70. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Pick your “read” :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ Or we can be a bit more functional...: reader forEach((t: Tweet) => println(t.name + “: “ + t.msg))
  • 71. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Setting QoS :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Example ‣ Setting Durability and History on the TopicQos val qos = TopicQos() <= PersistentDurability() <= KeepLastHistory(tweetHistory) val topic = Topic[Tweet](“Tweet”, qos, pub)
  • 72. Stepping Into :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Demo Time
  • 73. OpenSplice DDS The Universal Data Bus :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: Summing-Up +/-*
  • 74. OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DDS OpenSplice DD Summing Up :: http://www.opensplice.org :: http://www.opensplice.com :: http://www.prismtech.com :: ‣ A good type system can help in the development of both traditional and distributed applications, as it improves code quality, productivity, safety and runtime efficiency ‣ Scala and OpenSplice DDS are a very powerful combination since provide scalable language and middleware mechanism for building large scale complex distributed systems
  • 75. OpenSplice DDS Delivering Performance, Openness, and Freedom http://www.opensplice.com/ References http://www.opensplice.org/ http://www.slideshare.net/angelo.corsaro emailto:opensplicedds@prismtech.com http://bit.ly/1Sreg http://twitter.com/acorsaro/ http://www.youtube.com/OpenSpliceTube http://opensplice.blogspot.com