SlideShare a Scribd company logo
1 of 42
Download to read offline
March 11, 2016
Voxxed Days Bucharest
Reactive Java
Robotics and IoT
Trayan Iliev
CTO of IPT – Intellectual
Products & Technologies
http://robolearn.org/
http://iproduct.org/
Tales of JAVA Robotics
2
There are so many tales to share…
Where should I start? ... from the Beginning …
 Tale of Common Sense: DDD
 Tale of Segregation between Queries and
Commands, and ultimate Event Sourcing
 Tale of two cities - Imperative and Reactive
 Tale of two brave robots: LeJaRo and IPTPI
 And a lot of real reactive Java
+ TypeScript / Angular 2 / WebSocket code 
Oracle® and Java™ are trademarks or registered trademarks of Oracle and/or its affiliates. Other
names may be trademarks of their respective owners.
Common Sense: DDD
3
There was a time upon …
When were
and people were
Simple times …
Common Sense: DDD
4
But then computers came and became more
… and more powerful …
The MareNostrum supercomputer in the Barcelona Supercomputing Center 
- National Supercomputing Center (BSC-CNS), Spain. (Photo: IBM Research/Flickr)
Common Sense: DDD
5
People could not easily cope with the
complexity of problems being modeled anymore
Simple solutions are needed – cope with
problems through divide and concur on different
levels of abstraction: Domain Driven Design –
back to basics: data, domain objects.
Described by Eric Evans in his book:
Domain Driven Design: Tackling Complexity in
the Heart of Software
Common Sense: DDD
6
Actually DDD require additional efforts (as most
other divide and concur modeling approaches :)
 Ubiquitous language and Bounded Contexts
 DDD Application Layers: Infrastructure,
Domain, Application, Presentation
 Hexagonal architecture :
OUTSIDE <-> transformer <-> ( application <->
domain ) [A. Cockburn]
Common Sense: DDD
7
Main concepts:
 Entities, value objects and modules
 Aggregates and Aggregate Roots [Haywood]:
value < entity < aggregate < module < BC
 Repositories, Factories and Services:
application services <-> domain services
 Separating interface from implementation
CQRS and Event Sourcing
8
Queries and Commands have different
requirements:
 Queries – eventual consistency, no need for
transactions (idempotent), caching is essential,
reporting DB de-normalization, often report
aggregate data, Naked Objects (Material Views)
 Commands – often transactional, eventual
consistency may be not ok, normalized DB,
usually manage single entities
Imperative and Reactive
9
We live in a Connected Universe
The title refers to the butterfly
effect, a popular hypothetical
example of chaos theory
which illustrates how small
initial differences may
activate chains of events
leading to large and often
unforeseen consequences in
the future...
Imperative and Reactive
10
We live in a Connected Universe
... there is hypothesis that all the things in the
Universe are intimately connected, and you can
not change a bit without changing all.
Action – Reaction principle is the essence of
how Universe behaves.
Imperative and Reactive
11
 Reactive Programming [Wikipedia]: a programming paradigm
oriented around data flows and the propagation of change. This
means that it should be possible to express static or dynamic
data flows with ease in the programming languages used, and
that the underlying execution model will automatically propagate
changes through the data flow. Ex: a := b + c
Functional Programming [Wikipedia]: a programming paradigm
that treats computation as the evaluation of mathematical
functions and avoids changing-state and mutable data. It is a
declarative programming paradigm. Eliminating side effects can
make it much easier to understand and predict the program
behavior. Ex: books.stream().filter(book ->
book.getYear() > 2010 ). forEach( System.out::println )
Functional Reactive (FRP)
12
According to Connal Elliot's answer in Stack Overflow
(ground-breaking paper @ Conference on Functional
Programming, 1997):
I'm glad you're starting by asking about a specification rather
than implementation first. There are a lot of ideas floating
around about what FRP is. For me it's always been two things: 
(a) denotative and (b) temporally continuous. Many folks 
drop both of these properties and identify FRP with various 
implementation notions, all of which are beside the point in my 
perspective. 
" Functional Reactive Programming (FRP) = Denotative,
Continuous-Time Programming (DCTP) "
Reactive Manifesto
13
[http://www.reactivemanifesto.org]
Reactive Programming
14
 Microsoft® opens source polyglot project ReactiveX
(Reactive Extensions) [http://reactivex.io]:
Rx = Observables + LINQ + Schedulers :)
Java: RxJava, JavaScript: RxJS, C#: Rx.NET, C#(Unity): UniRx, Scala: RxScala,
Clojure: RxClojure, C++: RxCpp, Ruby: Rx.rb, Python: RxPY, Groovy: RxGroovy,
JRuby: RxJRuby, Kotlin: RxKotlin, Swift: RxSwift
Reactive Streams Specification
[http://www.reactive-streams.org/] used by
(Spring) Project Reactor
[http://projectreactor.io/, https://github.com/reactor/reactor]
Reactive Streams Spec.
15
 Reactive Streams – provides standard for
asynchronous stream processing with non-blocking
back pressure. This encompasses efforts aimed at
runtime environments (JVM & JavaScript) as well as
network protocols.
 Minimal set of interfaces, methods and protocols for
asynchronous data streams
 As of April 30, 2015 have been released version
1.0.0 of Reactive Streams for the JVM, including
Java API, a textual Specification, a TCK and
implementation examples.
Reactive Streams Spec.
16
 Publisher – provider of potentially unbounded number of
sequenced elements, according to Subscriber(s) demand. After
invoking Publisher.subscribe(Subscriber). Subscriber methods
protocol is: onSubscribe onNext* (onError | onComplete)?
 Subscriber – receives call to onSubscribe(Subscription)
once after passing an instance to
Publisher.subscribe(Subscriber). No further notifications until
Subscription.request(long) is called.
 Subscription – represents one-to-one lifecycle of a
Subscriber subscribing to a Publisher. It is used to both signal
desire for data and cancel demand (allow resource cleanup).
 Processor -represents a processing stage, which is both a
Subscriber and Publisher and obeys the contracts of both.
RP = Async Data Streams
17
 Functional Reactive Programming (FRP) [Wikipedia]:
asynchronous dataflow programming using the building blocks
of functional programming (e.g. map, reduce, filter). FRP has
been used for programming graphical user interfaces (GUIs),
robotics, and music, aiming to simplify these problems by
explicitly modeling time. Example (RxJava):
Observable.from(new String[]{"Reactive",
"Extensions", "Java"})
.take(2).map(s -> s + " : on " + new Date())
.subscribe(s -> System.out.println(s));
Result:
Reactive : on Wed Jun 17 21:54:02 GMT+02:00 2015
Extensions : on Wed Jun 17 21:54:02 GMT+02:00 2015
Imperative and Reactive
18
Queries and Commands have different
requirements:
 Queries – eventual consistency, no need for
transactions (idempotent), caching is essential,
reporting DB de-normalization, often report
aggregate data, Naked Objects (Material Views)
 Commands – often transactional, eventual
consistency may be not ok, normalized DB,
usually manage single entities
Reactor Design Pattern
19
Proactor Design Pattern
20
Project Reactor
21
 Reactor project allows building high-
performance (low latency high throughput) non-
blocking asynchronous applications on JVM.
 Reactor is designed to be extraordinarily fast
and can sustain throughput rates on torder of
10's of millions of operations per second.
 Reactor has powerful API for declaring data
transformations and functional composition.
Makes use of the concept of Mechanical
Sympathy built on top of Disruptor / RingBuffer.
Project Reactor
22
Pre-allocation at startup-time;
Message-passing structures are bounded;
Using Reactive and Event-Driven Architecture
patterns => non-blocking end-to-end flows, replies;
Implement Reactive Streams Specification, to make
bounded structures efficient by not requesting more
than their capacity;
Applies above features to IPC and provides non-
blocking IO drivers that are flow-control aware;
Expose a Functional API - organize their code in a
side-effect free way, which helps you determine you
are thread-safe and fault-tolerant.
Reactor: Hello World
23
public class ReactorHelloWorld {
public static void main(String... args) throws
InterruptedException {
Broadcaster<String> sink = Broadcaster.create();
SchedulerGroup sched = SchedulerGroup.async();
sink.dispatchOn(sched)
.map(String::toUpperCase)
.filter(s -> s.startsWith("HELLO"))
.consume(s -> System.out.printf("s=%s%n", s));
sink.onNext("Hello World!");
sink.onNext("Goodbye World!");
Thread.sleep(500);
}
}
Reactor Bus: IPTPI
24
LeJaRo: Lego®
Java Robot
25
Modular – 3 motors (with encoders) – one driving
each track, and third for robot clamp.
Three sensors: touch sensor (obstacle avoidance),
light color sensor (follow line), IR sensor (remote).
LeJaRo is programmed in Java using LeJOS library.
More information about LeJaRo:
http://robolearn.org/lejaro/
Programming examples available @GitHub:
https://github.com/iproduct/course-social-robotics/tr
ee/master/motors_demo
LEGO® is a registered trademark of LEGO® Group. Programs of IPT are not affiliated, sponsored
or endorsed by LEGO® Education or LEGO® Group.
26
IPTPI: RPi2 + Ardunio Robot
27
Raspberry Pi 2 (quad-core
ARMv7 @ 900MHz) + Arduino
Leonardo cloneA-Star 32U4 Micro
Optical encoders (custom), IR
optical array, 3D accelerometers,
gyros, and compass MinIMU-9 v2
IPTPI is programmed in Java
using Pi4J, Reactor, RxJava, Akka
More information about IPTPI:
http://robolearn.org/iptpi-robot/
28
Tale of Simplicity: DDD
29
Lets See Some Code 
30
VOXXED Demo code is available @ GitHub:
https://github.com/iproduct/voxxed-demo
IPTPI Reactive Streams
31
Encoder
Readings
ArduinoData
Fluxion
Arduino
SerialData
Position
Fluxion
Robot
Positions
Command
Movement
Subscriber
RobotWSService
(using Reactor)
Angular 2 /
TypeScript
MovementCommands
IPTPI: IPTPIVoxxedDemo I
32
public class IPTPIVoxxedDemo {
...
public IPTPIVoxxedDemo() {
//receive Arduino data readings
arduino = ArduinoDataFactory.createArduinoDataFluxion();
//calculate robot positions
positionsPub =PositionFactory.createPositionFluxion(arduino);
presentationViews.add(
PositionFactory.createPositionPanel(positionsPub));
//wire robot main controller with services
moveSub = MovementFactory
.createCommandMovementSubscriber(positionsPub);
controller = new RobotController(
Subscribers.consumer(this::tearDown),moveSub);
IPTPI: IPTPIVoxxedDemo II
33
//create view with controller and delegate material views
//from query services
view = new RobotView("IPTPI Reactive Robotics Demo",
controller, presentationViews);
//expose as WS service
movementSub2 = MovementFactory
.createCommandMovementSubscriber(positionsPub);
positionsService =
new RobotWSService(positionsPub, movementSub2);
}
public static void main(String[] args) {
IPTPIVoxxedDemo demo = new IPTPIVoxxedDemo();
}
IPTPI: ArduinoDataFluxion I
34
fluxion = Broadcaster.create();
emitter = fluxion.startEmitter();
final Serial serial = SerialFactory.createInstance();
serial.addListener(new SerialDataEventListener() {
private ByteBuffer buffer = ByteBuffer.allocate(1024);
@Override
public void dataReceived(SerialDataEvent event) {
try {
ByteBuffer newBuffer = event.getByteBuffer();
buffer.put(newBuffer);
buffer.flip();
...
buffer.get();
long timestamp = buffer.getInt(); //get timestamp
int encoderL = -buffer.getInt(); //motors mirrored
int encoderR = buffer.getInt();
IPTPI: ArduinoDataFluxion II
35
EncoderReadings readings =
new EncoderReadings(encoderR, encoderL, timestamp);
emitter.submit(readings);
...
buffer.compact();
} catch (Exception e) {
e.printStackTrace();
}
}
});
try {
serial.open(PORT, 38400);
} catch(SerialPortException | IOException ex) {
System.out.println(“SERIAL SETUP FAILED:"+ex.getMessage());
}
IPTPI: PositionFluxion I
36
CommandMovementSubscriber I
37
public class CommandMovementSubscriber extends
ConsumerSubscriber<Command<Movement>> {
private PositionFluxion positions;
public CommandMovementSubscriber(PositionFluxion positions){
this.positions = positions;
Gpio.wiringPiSetupGpio(); // initialize wiringPi library
Gpio.pinMode(5, Gpio.OUTPUT); // Motor direction pins
Gpio.pinMode(6, Gpio.OUTPUT);
Gpio.pinMode(12, Gpio.PWM_OUTPUT); // Motor speed pins
Gpio.pinMode(13, Gpio.PWM_OUTPUT);
Gpio.pwmSetMode(Gpio.PWM_MODE_MS);
Gpio.pwmSetRange(MAX_SPEED);
Gpio.pwmSetClock(CLOCK_DIVISOR);
}
@Override
public void doNext(Command<Movement> command) { ... }
}
CommandMovementSubscriber II
38
private void runMotors(MotorsCommand mc) {
//setting motor directions
Gpio.digitalWrite(5, mc.getDirR() > 0 ? 1 : 0);
Gpio.digitalWrite(6, mc.getDirL() > 0 ? 1 : 0);
//setting speed
if(mc.getVelocityR()>=0 && mc.getVelocityR() <=MAX_SPEED)
Gpio.pwmWrite(12, mc.getVelocityR()); // set speed
if(mc.getVelocityL()>=0 && mc.getVelocityL() <=MAX_SPEED)
Gpio.pwmWrite(13, mc.getVelocityL());
}
}
IPTPI: RobotWSService I
39
private void setupServer() throws InterruptedException {
httpServer = NetStreams.<Buffer, Buffer>httpServer(
HttpServerSpec<Buffer,Buffer> serverSpec ->
serverSpec.listen("172.22.0.68", 80)
);
httpServer.get("/", getStaticResourceHandler());
httpServer.get("/index.html", getStaticResourceHandler());
httpServer.get("/app/**", getStaticResourceHandler());
...
httpServer.ws("/ws", getWsHandler());
httpServer.start().subscribe(
Subscribers.consumer(System.out::println));
}
IPTPI: RobotWSService II
40
private ReactorHttpHandler<Buffer, Buffer> getWsHandler() {
return channel -> {
System.out.println("Connected a websocket client: " +
channel.remoteAddress());
channel.map(Buffer::asString).consume(
json -> {
System.out.printf(“WS Message: %s%n“, json);
Movement movement = gson.fromJson(json, Movement.class);
movementCommands.onNext(new Command<>("move", movement));
});
return positions.flatMap(position ->
channel.writeWith(
Flux.just(Buffer.wrap(gson.toJson(position)))
));
};
}
Additional Resources
41
IPT Reactive Java/JS/Typescript and Angular 2
courses: http://iproduct.org
More information about robots @RoboLearn:
http://robolearn.org/
Lots of Java robotics and IoT resources
@Social Robotics Course GitHub Wiki:
https://github.com/iproduct/course-social-
robotics/wiki/Lectures
Thank’s for Your Attention!
42
Trayan Iliev
CTO of IPT – Intellectual Products
& Technologies
http://iproduct.org/
http://robolearn.org/
https://github.com/iproduct
https://twitter.com/trayaniliev
https://www.facebook.com/IPT.EACAD
https://plus.google.com/+IproductOrg

More Related Content

What's hot

Reactive robotics io_t_2017
Reactive robotics io_t_2017Reactive robotics io_t_2017
Reactive robotics io_t_2017Trayan Iliev
 
Complex Environment Evolution
Complex Environment EvolutionComplex Environment Evolution
Complex Environment EvolutionAndrej Eisfeld
 
Elastic High Performance Applications – A Composition Framework
Elastic High Performance Applications – A Composition FrameworkElastic High Performance Applications – A Composition Framework
Elastic High Performance Applications – A Composition FrameworkHong-Linh Truong
 
第1回バイオインフォマティクスデータ可視化セミナー@Riken
第1回バイオインフォマティクスデータ可視化セミナー@Riken第1回バイオインフォマティクスデータ可視化セミナー@Riken
第1回バイオインフォマティクスデータ可視化セミナー@RikenKeiichiro Ono
 

What's hot (6)

Reactive robotics io_t_2017
Reactive robotics io_t_2017Reactive robotics io_t_2017
Reactive robotics io_t_2017
 
Complex Environment Evolution
Complex Environment EvolutionComplex Environment Evolution
Complex Environment Evolution
 
Aplicações Potenciais de Deep Learning à Indústria do Petróleo
Aplicações Potenciais de Deep Learning à Indústria do PetróleoAplicações Potenciais de Deep Learning à Indústria do Petróleo
Aplicações Potenciais de Deep Learning à Indústria do Petróleo
 
Sai Dheeraj_Resume
Sai Dheeraj_ResumeSai Dheeraj_Resume
Sai Dheeraj_Resume
 
Elastic High Performance Applications – A Composition Framework
Elastic High Performance Applications – A Composition FrameworkElastic High Performance Applications – A Composition Framework
Elastic High Performance Applications – A Composition Framework
 
第1回バイオインフォマティクスデータ可視化セミナー@Riken
第1回バイオインフォマティクスデータ可視化セミナー@Riken第1回バイオインフォマティクスデータ可視化セミナー@Riken
第1回バイオインフォマティクスデータ可視化セミナー@Riken
 

Viewers also liked

IPT – Java Robotics and IoT
IPT – Java Robotics and IoTIPT – Java Robotics and IoT
IPT – Java Robotics and IoTTrayan Iliev
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto ProjectLeon Anavi
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOpen Mobile Alliance
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and CaliforniumJulien Vermillard
 
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Julien Vermillard
 
Standards Drive the Internet of Things
Standards Drive the Internet of ThingsStandards Drive the Internet of Things
Standards Drive the Internet of Thingszdshelby
 
ESP8266 and IOT
ESP8266 and IOTESP8266 and IOT
ESP8266 and IOTdega1999
 
Hands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanHands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanJulien Vermillard
 
OMA Lightweight M2M Tutorial
OMA Lightweight M2M TutorialOMA Lightweight M2M Tutorial
OMA Lightweight M2M Tutorialzdshelby
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1Andy Gelme
 
A reference architecture for the internet of things
A reference architecture for the internet of thingsA reference architecture for the internet of things
A reference architecture for the internet of thingsCharles Gibbons
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Baoshi Zhu
 
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Internet of Things (IoT) protocols  COAP MQTT OSCON2014Internet of Things (IoT) protocols  COAP MQTT OSCON2014
Internet of Things (IoT) protocols COAP MQTT OSCON2014Vidhya Gholkar
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT WSO2
 
IoT Cloud architecture
IoT Cloud architectureIoT Cloud architecture
IoT Cloud architectureMachinePulse
 
What exactly is the "Internet of Things"?
What exactly is the "Internet of Things"?What exactly is the "Internet of Things"?
What exactly is the "Internet of Things"?Dr. Mazlan Abbas
 
End-to-end IoT solutions with Java and the Eclipse IoT stack
End-to-end IoT solutions with Java and the Eclipse IoT stackEnd-to-end IoT solutions with Java and the Eclipse IoT stack
End-to-end IoT solutions with Java and the Eclipse IoT stackBenjamin Cabé
 

Viewers also liked (20)

IPT – Java Robotics and IoT
IPT – Java Robotics and IoTIPT – Java Robotics and IoT
IPT – Java Robotics and IoT
 
The Yocto Project
The Yocto ProjectThe Yocto Project
The Yocto Project
 
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation
 
SemIoT (Semantic technologies for Internet of Things) - Project Overview
SemIoT (Semantic technologies for Internet of Things) - Project OverviewSemIoT (Semantic technologies for Internet of Things) - Project Overview
SemIoT (Semantic technologies for Internet of Things) - Project Overview
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
 
Standards Drive the Internet of Things
Standards Drive the Internet of ThingsStandards Drive the Internet of Things
Standards Drive the Internet of Things
 
ESP8266 and IOT
ESP8266 and IOTESP8266 and IOT
ESP8266 and IOT
 
Hands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse LeshanHands on with lightweight m2m and Eclipse Leshan
Hands on with lightweight m2m and Eclipse Leshan
 
OMA Lightweight M2M Tutorial
OMA Lightweight M2M TutorialOMA Lightweight M2M Tutorial
OMA Lightweight M2M Tutorial
 
NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1NodeMCU ESP8266 workshop 1
NodeMCU ESP8266 workshop 1
 
Introducing Akka
Introducing AkkaIntroducing Akka
Introducing Akka
 
A reference architecture for the internet of things
A reference architecture for the internet of thingsA reference architecture for the internet of things
A reference architecture for the internet of things
 
Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266Build WiFi gadgets using esp8266
Build WiFi gadgets using esp8266
 
Understanding the Internet of Things Protocols
Understanding the Internet of Things ProtocolsUnderstanding the Internet of Things Protocols
Understanding the Internet of Things Protocols
 
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Internet of Things (IoT) protocols  COAP MQTT OSCON2014Internet of Things (IoT) protocols  COAP MQTT OSCON2014
Internet of Things (IoT) protocols COAP MQTT OSCON2014
 
A Reference Architecture for IoT
A Reference Architecture for IoT A Reference Architecture for IoT
A Reference Architecture for IoT
 
IoT Cloud architecture
IoT Cloud architectureIoT Cloud architecture
IoT Cloud architecture
 
What exactly is the "Internet of Things"?
What exactly is the "Internet of Things"?What exactly is the "Internet of Things"?
What exactly is the "Internet of Things"?
 
End-to-end IoT solutions with Java and the Eclipse IoT stack
End-to-end IoT solutions with Java and the Eclipse IoT stackEnd-to-end IoT solutions with Java and the Eclipse IoT stack
End-to-end IoT solutions with Java and the Eclipse IoT stack
 

Similar to Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016

NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in DepthTrayan Iliev
 
Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Trayan Iliev
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
 
Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016ilievt
 
Making Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxMaking Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxTrayan Iliev
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorTrayan Iliev
 
Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
 
Microservices Part 4: Functional Reactive Programming
Microservices Part 4: Functional Reactive ProgrammingMicroservices Part 4: Functional Reactive Programming
Microservices Part 4: Functional Reactive ProgrammingAraf Karsh Hamid
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programmingAraf Karsh Hamid
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Codemotion
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingFabio Tiriticco
 
LarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC
 
Intro to Reactor
Intro to ReactorIntro to Reactor
Intro to ReactorJon Brisbin
 
Reactive java programming for the impatient
Reactive java programming for the impatientReactive java programming for the impatient
Reactive java programming for the impatientGrant Steinfeld
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaAli Muzaffar
 
RDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactRDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactJean-Paul Calbimonte
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2bdemchak
 
Zou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 ConciseZou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 Conciseyongqiangzou
 

Similar to Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016 (20)

NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in Depth
 
Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018Spring 5 Webflux - Advances in Java 2018
Spring 5 Webflux - Advances in Java 2018
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionals
 
Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016Reactive Java Robotics and IoT 2016
Reactive Java Robotics and IoT 2016
 
Making Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFluxMaking Machine Learning Easy with H2O and WebFlux
Making Machine Learning Easy with H2O and WebFlux
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring Reactor
 
Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9Stream Processing with CompletableFuture and Flow in Java 9
Stream Processing with CompletableFuture and Flow in Java 9
 
Microservices Part 4: Functional Reactive Programming
Microservices Part 4: Functional Reactive ProgrammingMicroservices Part 4: Functional Reactive Programming
Microservices Part 4: Functional Reactive Programming
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programming
 
DZone_RC_RxJS
DZone_RC_RxJSDZone_RC_RxJS
DZone_RC_RxJS
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
LarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - IntroductionLarKC Tutorial at ISWC 2009 - Introduction
LarKC Tutorial at ISWC 2009 - Introduction
 
Intro to Reactor
Intro to ReactorIntro to Reactor
Intro to Reactor
 
Reactive java programming for the impatient
Reactive java programming for the impatientReactive java programming for the impatient
Reactive java programming for the impatient
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
RDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactRDF Stream Processing: Let's React
RDF Stream Processing: Let's React
 
Cytoscape CI Chapter 2
Cytoscape CI Chapter 2Cytoscape CI Chapter 2
Cytoscape CI Chapter 2
 
Rx Swift
Rx SwiftRx Swift
Rx Swift
 
Zou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 ConciseZou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 Concise
 

More from Trayan Iliev

Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorTrayan Iliev
 
Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Trayan Iliev
 
Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Trayan Iliev
 
Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Trayan Iliev
 
React HOCs, Context and Observables
React HOCs, Context and ObservablesReact HOCs, Context and Observables
React HOCs, Context and ObservablesTrayan Iliev
 
Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Trayan Iliev
 
IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016Trayan Iliev
 
IPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTIPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTTrayan Iliev
 
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Trayan Iliev
 

More from Trayan Iliev (9)

Rapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and KtorRapid Web API development with Kotlin and Ktor
Rapid Web API development with Kotlin and Ktor
 
Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018 Learning Programming Using Robots - Sofia University Conference 2018
Learning Programming Using Robots - Sofia University Conference 2018
 
Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)Active Learning Using Connected Things - 2018 (in Bulgarian)
Active Learning Using Connected Things - 2018 (in Bulgarian)
 
Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018Fog Computing - DEV.BG 2018
Fog Computing - DEV.BG 2018
 
React HOCs, Context and Observables
React HOCs, Context and ObservablesReact HOCs, Context and Observables
React HOCs, Context and Observables
 
Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”Hackathon: “IPTPI and LeJaRo Meet The Real World”
Hackathon: “IPTPI and LeJaRo Meet The Real World”
 
IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016IPT angular2 typescript SPA 2016
IPT angular2 typescript SPA 2016
 
IPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoTIPT Workshops on Java Robotics and IoT
IPT Workshops on Java Robotics and IoT
 
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 

Recently uploaded (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 

Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016

  • 1. March 11, 2016 Voxxed Days Bucharest Reactive Java Robotics and IoT Trayan Iliev CTO of IPT – Intellectual Products & Technologies http://robolearn.org/ http://iproduct.org/
  • 2. Tales of JAVA Robotics 2 There are so many tales to share… Where should I start? ... from the Beginning …  Tale of Common Sense: DDD  Tale of Segregation between Queries and Commands, and ultimate Event Sourcing  Tale of two cities - Imperative and Reactive  Tale of two brave robots: LeJaRo and IPTPI  And a lot of real reactive Java + TypeScript / Angular 2 / WebSocket code  Oracle® and Java™ are trademarks or registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
  • 3. Common Sense: DDD 3 There was a time upon … When were and people were Simple times …
  • 4. Common Sense: DDD 4 But then computers came and became more … and more powerful … The MareNostrum supercomputer in the Barcelona Supercomputing Center  - National Supercomputing Center (BSC-CNS), Spain. (Photo: IBM Research/Flickr)
  • 5. Common Sense: DDD 5 People could not easily cope with the complexity of problems being modeled anymore Simple solutions are needed – cope with problems through divide and concur on different levels of abstraction: Domain Driven Design – back to basics: data, domain objects. Described by Eric Evans in his book: Domain Driven Design: Tackling Complexity in the Heart of Software
  • 6. Common Sense: DDD 6 Actually DDD require additional efforts (as most other divide and concur modeling approaches :)  Ubiquitous language and Bounded Contexts  DDD Application Layers: Infrastructure, Domain, Application, Presentation  Hexagonal architecture : OUTSIDE <-> transformer <-> ( application <-> domain ) [A. Cockburn]
  • 7. Common Sense: DDD 7 Main concepts:  Entities, value objects and modules  Aggregates and Aggregate Roots [Haywood]: value < entity < aggregate < module < BC  Repositories, Factories and Services: application services <-> domain services  Separating interface from implementation
  • 8. CQRS and Event Sourcing 8 Queries and Commands have different requirements:  Queries – eventual consistency, no need for transactions (idempotent), caching is essential, reporting DB de-normalization, often report aggregate data, Naked Objects (Material Views)  Commands – often transactional, eventual consistency may be not ok, normalized DB, usually manage single entities
  • 9. Imperative and Reactive 9 We live in a Connected Universe The title refers to the butterfly effect, a popular hypothetical example of chaos theory which illustrates how small initial differences may activate chains of events leading to large and often unforeseen consequences in the future...
  • 10. Imperative and Reactive 10 We live in a Connected Universe ... there is hypothesis that all the things in the Universe are intimately connected, and you can not change a bit without changing all. Action – Reaction principle is the essence of how Universe behaves.
  • 11. Imperative and Reactive 11  Reactive Programming [Wikipedia]: a programming paradigm oriented around data flows and the propagation of change. This means that it should be possible to express static or dynamic data flows with ease in the programming languages used, and that the underlying execution model will automatically propagate changes through the data flow. Ex: a := b + c Functional Programming [Wikipedia]: a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm. Eliminating side effects can make it much easier to understand and predict the program behavior. Ex: books.stream().filter(book -> book.getYear() > 2010 ). forEach( System.out::println )
  • 12. Functional Reactive (FRP) 12 According to Connal Elliot's answer in Stack Overflow (ground-breaking paper @ Conference on Functional Programming, 1997): I'm glad you're starting by asking about a specification rather than implementation first. There are a lot of ideas floating around about what FRP is. For me it's always been two things:  (a) denotative and (b) temporally continuous. Many folks  drop both of these properties and identify FRP with various  implementation notions, all of which are beside the point in my  perspective.  " Functional Reactive Programming (FRP) = Denotative, Continuous-Time Programming (DCTP) "
  • 14. Reactive Programming 14  Microsoft® opens source polyglot project ReactiveX (Reactive Extensions) [http://reactivex.io]: Rx = Observables + LINQ + Schedulers :) Java: RxJava, JavaScript: RxJS, C#: Rx.NET, C#(Unity): UniRx, Scala: RxScala, Clojure: RxClojure, C++: RxCpp, Ruby: Rx.rb, Python: RxPY, Groovy: RxGroovy, JRuby: RxJRuby, Kotlin: RxKotlin, Swift: RxSwift Reactive Streams Specification [http://www.reactive-streams.org/] used by (Spring) Project Reactor [http://projectreactor.io/, https://github.com/reactor/reactor]
  • 15. Reactive Streams Spec. 15  Reactive Streams – provides standard for asynchronous stream processing with non-blocking back pressure. This encompasses efforts aimed at runtime environments (JVM & JavaScript) as well as network protocols.  Minimal set of interfaces, methods and protocols for asynchronous data streams  As of April 30, 2015 have been released version 1.0.0 of Reactive Streams for the JVM, including Java API, a textual Specification, a TCK and implementation examples.
  • 16. Reactive Streams Spec. 16  Publisher – provider of potentially unbounded number of sequenced elements, according to Subscriber(s) demand. After invoking Publisher.subscribe(Subscriber). Subscriber methods protocol is: onSubscribe onNext* (onError | onComplete)?  Subscriber – receives call to onSubscribe(Subscription) once after passing an instance to Publisher.subscribe(Subscriber). No further notifications until Subscription.request(long) is called.  Subscription – represents one-to-one lifecycle of a Subscriber subscribing to a Publisher. It is used to both signal desire for data and cancel demand (allow resource cleanup).  Processor -represents a processing stage, which is both a Subscriber and Publisher and obeys the contracts of both.
  • 17. RP = Async Data Streams 17  Functional Reactive Programming (FRP) [Wikipedia]: asynchronous dataflow programming using the building blocks of functional programming (e.g. map, reduce, filter). FRP has been used for programming graphical user interfaces (GUIs), robotics, and music, aiming to simplify these problems by explicitly modeling time. Example (RxJava): Observable.from(new String[]{"Reactive", "Extensions", "Java"}) .take(2).map(s -> s + " : on " + new Date()) .subscribe(s -> System.out.println(s)); Result: Reactive : on Wed Jun 17 21:54:02 GMT+02:00 2015 Extensions : on Wed Jun 17 21:54:02 GMT+02:00 2015
  • 18. Imperative and Reactive 18 Queries and Commands have different requirements:  Queries – eventual consistency, no need for transactions (idempotent), caching is essential, reporting DB de-normalization, often report aggregate data, Naked Objects (Material Views)  Commands – often transactional, eventual consistency may be not ok, normalized DB, usually manage single entities
  • 21. Project Reactor 21  Reactor project allows building high- performance (low latency high throughput) non- blocking asynchronous applications on JVM.  Reactor is designed to be extraordinarily fast and can sustain throughput rates on torder of 10's of millions of operations per second.  Reactor has powerful API for declaring data transformations and functional composition. Makes use of the concept of Mechanical Sympathy built on top of Disruptor / RingBuffer.
  • 22. Project Reactor 22 Pre-allocation at startup-time; Message-passing structures are bounded; Using Reactive and Event-Driven Architecture patterns => non-blocking end-to-end flows, replies; Implement Reactive Streams Specification, to make bounded structures efficient by not requesting more than their capacity; Applies above features to IPC and provides non- blocking IO drivers that are flow-control aware; Expose a Functional API - organize their code in a side-effect free way, which helps you determine you are thread-safe and fault-tolerant.
  • 23. Reactor: Hello World 23 public class ReactorHelloWorld { public static void main(String... args) throws InterruptedException { Broadcaster<String> sink = Broadcaster.create(); SchedulerGroup sched = SchedulerGroup.async(); sink.dispatchOn(sched) .map(String::toUpperCase) .filter(s -> s.startsWith("HELLO")) .consume(s -> System.out.printf("s=%s%n", s)); sink.onNext("Hello World!"); sink.onNext("Goodbye World!"); Thread.sleep(500); } }
  • 25. LeJaRo: Lego® Java Robot 25 Modular – 3 motors (with encoders) – one driving each track, and third for robot clamp. Three sensors: touch sensor (obstacle avoidance), light color sensor (follow line), IR sensor (remote). LeJaRo is programmed in Java using LeJOS library. More information about LeJaRo: http://robolearn.org/lejaro/ Programming examples available @GitHub: https://github.com/iproduct/course-social-robotics/tr ee/master/motors_demo LEGO® is a registered trademark of LEGO® Group. Programs of IPT are not affiliated, sponsored or endorsed by LEGO® Education or LEGO® Group.
  • 26. 26
  • 27. IPTPI: RPi2 + Ardunio Robot 27 Raspberry Pi 2 (quad-core ARMv7 @ 900MHz) + Arduino Leonardo cloneA-Star 32U4 Micro Optical encoders (custom), IR optical array, 3D accelerometers, gyros, and compass MinIMU-9 v2 IPTPI is programmed in Java using Pi4J, Reactor, RxJava, Akka More information about IPTPI: http://robolearn.org/iptpi-robot/
  • 28. 28
  • 30. Lets See Some Code  30 VOXXED Demo code is available @ GitHub: https://github.com/iproduct/voxxed-demo
  • 32. IPTPI: IPTPIVoxxedDemo I 32 public class IPTPIVoxxedDemo { ... public IPTPIVoxxedDemo() { //receive Arduino data readings arduino = ArduinoDataFactory.createArduinoDataFluxion(); //calculate robot positions positionsPub =PositionFactory.createPositionFluxion(arduino); presentationViews.add( PositionFactory.createPositionPanel(positionsPub)); //wire robot main controller with services moveSub = MovementFactory .createCommandMovementSubscriber(positionsPub); controller = new RobotController( Subscribers.consumer(this::tearDown),moveSub);
  • 33. IPTPI: IPTPIVoxxedDemo II 33 //create view with controller and delegate material views //from query services view = new RobotView("IPTPI Reactive Robotics Demo", controller, presentationViews); //expose as WS service movementSub2 = MovementFactory .createCommandMovementSubscriber(positionsPub); positionsService = new RobotWSService(positionsPub, movementSub2); } public static void main(String[] args) { IPTPIVoxxedDemo demo = new IPTPIVoxxedDemo(); }
  • 34. IPTPI: ArduinoDataFluxion I 34 fluxion = Broadcaster.create(); emitter = fluxion.startEmitter(); final Serial serial = SerialFactory.createInstance(); serial.addListener(new SerialDataEventListener() { private ByteBuffer buffer = ByteBuffer.allocate(1024); @Override public void dataReceived(SerialDataEvent event) { try { ByteBuffer newBuffer = event.getByteBuffer(); buffer.put(newBuffer); buffer.flip(); ... buffer.get(); long timestamp = buffer.getInt(); //get timestamp int encoderL = -buffer.getInt(); //motors mirrored int encoderR = buffer.getInt();
  • 35. IPTPI: ArduinoDataFluxion II 35 EncoderReadings readings = new EncoderReadings(encoderR, encoderL, timestamp); emitter.submit(readings); ... buffer.compact(); } catch (Exception e) { e.printStackTrace(); } } }); try { serial.open(PORT, 38400); } catch(SerialPortException | IOException ex) { System.out.println(“SERIAL SETUP FAILED:"+ex.getMessage()); }
  • 37. CommandMovementSubscriber I 37 public class CommandMovementSubscriber extends ConsumerSubscriber<Command<Movement>> { private PositionFluxion positions; public CommandMovementSubscriber(PositionFluxion positions){ this.positions = positions; Gpio.wiringPiSetupGpio(); // initialize wiringPi library Gpio.pinMode(5, Gpio.OUTPUT); // Motor direction pins Gpio.pinMode(6, Gpio.OUTPUT); Gpio.pinMode(12, Gpio.PWM_OUTPUT); // Motor speed pins Gpio.pinMode(13, Gpio.PWM_OUTPUT); Gpio.pwmSetMode(Gpio.PWM_MODE_MS); Gpio.pwmSetRange(MAX_SPEED); Gpio.pwmSetClock(CLOCK_DIVISOR); } @Override public void doNext(Command<Movement> command) { ... } }
  • 38. CommandMovementSubscriber II 38 private void runMotors(MotorsCommand mc) { //setting motor directions Gpio.digitalWrite(5, mc.getDirR() > 0 ? 1 : 0); Gpio.digitalWrite(6, mc.getDirL() > 0 ? 1 : 0); //setting speed if(mc.getVelocityR()>=0 && mc.getVelocityR() <=MAX_SPEED) Gpio.pwmWrite(12, mc.getVelocityR()); // set speed if(mc.getVelocityL()>=0 && mc.getVelocityL() <=MAX_SPEED) Gpio.pwmWrite(13, mc.getVelocityL()); } }
  • 39. IPTPI: RobotWSService I 39 private void setupServer() throws InterruptedException { httpServer = NetStreams.<Buffer, Buffer>httpServer( HttpServerSpec<Buffer,Buffer> serverSpec -> serverSpec.listen("172.22.0.68", 80) ); httpServer.get("/", getStaticResourceHandler()); httpServer.get("/index.html", getStaticResourceHandler()); httpServer.get("/app/**", getStaticResourceHandler()); ... httpServer.ws("/ws", getWsHandler()); httpServer.start().subscribe( Subscribers.consumer(System.out::println)); }
  • 40. IPTPI: RobotWSService II 40 private ReactorHttpHandler<Buffer, Buffer> getWsHandler() { return channel -> { System.out.println("Connected a websocket client: " + channel.remoteAddress()); channel.map(Buffer::asString).consume( json -> { System.out.printf(“WS Message: %s%n“, json); Movement movement = gson.fromJson(json, Movement.class); movementCommands.onNext(new Command<>("move", movement)); }); return positions.flatMap(position -> channel.writeWith( Flux.just(Buffer.wrap(gson.toJson(position))) )); }; }
  • 41. Additional Resources 41 IPT Reactive Java/JS/Typescript and Angular 2 courses: http://iproduct.org More information about robots @RoboLearn: http://robolearn.org/ Lots of Java robotics and IoT resources @Social Robotics Course GitHub Wiki: https://github.com/iproduct/course-social- robotics/wiki/Lectures
  • 42. Thank’s for Your Attention! 42 Trayan Iliev CTO of IPT – Intellectual Products & Technologies http://iproduct.org/ http://robolearn.org/ https://github.com/iproduct https://twitter.com/trayaniliev https://www.facebook.com/IPT.EACAD https://plus.google.com/+IproductOrg