27
Cross language cooperation Oleksii Dukhno @ Lohika Systems

Cross-platform interaction

Embed Size (px)

Citation preview

Cross language

cooperation

Oleksii Dukhno @ Lohika Systems

Agenda

Why?

• Origin, Problems, Advantages

How?

• Approaches, Frameworks

Samples

• .NET WPF + JAVA ICP

• .NET + JAVA RPC

Analysis

• Pivot

Why?

INTEGRATION

• Process of bringing together the component subsystems into one system and ensuring that the subsystems function together as a system

Why?

LACK OF HUMAN RESOURCES

•Customer wants to have everything and right now

•Start-ups

•Huge projects

Why?

DO RiGHT THINGS RiGHT

•Mixing programming paradigms and polyglot programming

•Don’t use screwdriver for nailing

•Predicting a future

How?

THE MAIN PRINCIPLES

•Transformation

•Persistence

•Serialization

How?

INTEGRATION TOPOLOGIES

How?

INTEGRATION TOPOLOGIES

How?

THE MAIN METHODS

•Messages

•Resources

•Procedures

How?

MESSAGES – MESSAGE BUS

How?

MESSAGES – MESSAGE HUB

How?

MESSAGES – SOLUTIONS

AMQP

Exchange

• receives messages from publisher applications and routes these to "message queues", based on arbitrary criteria, usually message properties or content.

Message queue

• stores messages until they can be safely processed by a consuming client application (or multiple applications).

Binding

• defines the relationship between a message queue and an exchange and provides the message routing criteria

How?

MESSAGES – SOLUTIONS

AM

QP RabbitMQ

Windows Azure Service Bus

Windows Service Bus

How?

MESSAGES – PUBLISHER

How?

MESSAGES – SUBSCRIBER

How?

RESOURCES

REST

ROARESTFull

How?

RESOURCES ORIGIN

REST

• Fielding, Roy Thomas (2000), Architectural Styles and the Design of Network-based Software Architectures

ROA and RESTfull

• Richardson, Leonard; Ruby, Sam (2007). RESTful Web Services

How?

RESOURCESREST constraints:

Client-Server

•separation of concerns

Stateless

•Visibility, reliability and scalability

Cache

• improve network efficiency, but decrease reliability

Uniform Interface

•simplify architecture

Layered system

•Flexibility but degrades latency

Code on demand

•Reduces number of features to be implemented

How?

RESOURCES

ROA concepts:

Resources

Resources URIs

Resources Representation

Links between them (hypermedia)

How?

PROCEDURES - RPC

How?

RPC SOLUTIONS

XML-RPC JSON-RPC SOAP

Cisco – Etch ZeroC – ICEGoogle -ProtoBuf

Apache -Hadoop

Avro

Facebook -Thrift

Pivot table

Messages Resources Procedures

Supportability 3 3 3

Scalability 3 2 1

Performance 2 1 3

Expressiveness 1 2 3

Network

Throughput

3 2 3

Total: 12 11 13

APACHE THRIFT RPC ARCHITECTURE

Transport

• Http

• TCP Sockets

• Stream

• Your own

Protocol

packer

• JSON

• BSON

• Your own

Data generator

• Generators for: As3, C Glib, C++, C#, D, Delphi, Erlang, Go, Graphviz, Haskell, Java, Java Me, Javascript, Node.js, Objective-c, OCaml, Perl, PHP, Python, Ruby, Smalltalk

Apache Thrift IDL

IDLs

fileJAVA

branch

.NET

branch

JAVA

classes.NET

classes

SVN

Thrift

generatorThrift

generator

MODULE 1 MODULE 2externals

SAMPLES

JAVA -> .NET – CALCULATOR

.NET

Client

CLR

Machine 1

JAVA

server

JVM

Machine 2

JETT

Y

JAVA -> .NET – a Business App

.NET

Client

CLR

Machine

JAVA

server

JVM

WP

F

MS SQL

1 2

4 3