Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Event Driven User Interfaces

No description
by

Lee Campbell

on 1 December 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Event Driven User Interfaces

Event Driven User Interfaces
Managing Reactive
UI Complexity
Basic Requirements
Stream prices
Trade on prices
Fast and accurate trade response
Real time trade history
Challenges
Responsive
Resilient
Predictable latency
Consistent
Reactive Trader
Concurrency
and Asynchrony

When Things
Go Wrong

Coding
How to Stream Data
Request/Response is not good enough
Polling is wasteful
Various push solutions
Raw sockets
Web sockets
Proprietary
SignalR
Reactive Trader in action...
Single Threaded UI
Don't block the UI
Many cores don't help a single-threaded UI
As your app grows, the UI Thread becomes more contended
Choosing a Concurrency Model
On the UI thread, avoid..
I/O
Heavy computations
Enumerating long lists of data
Mapping/Translating
Concurrency is not free
Creating a thread is not free
Moving stack context is not free
ThreadPool starvation can hurt

Single threaded code is easier
Excessive concurrency can reduce performance and increase bugs

Only introduce concurrency when it buys you something
Favour Functional
Immutable where possible
Side-effect free
Framework support for monadic programming
async/await
Rx
Non-Happy Path
How Many Updates...
Conflation
Server Failures
Expected errors
Network silence/timeouts
Server failure
Make technical failure a non-technical event
Embrace asynchrony
everywhere!
Concurrency via API
Testable
Discoverable
Teachable
Querying with Concurrency

Asynchrony everywhere..
Prefer a single model of asynchrony
Force asynchrony into that model as soon as possible
Avoid Different APIs
Go observable early
Embrace different concepts
All interaction with the user is asynchronous
User and I/O events should be observable
Functional types work to your streams' advantage
Everything Is a Stream
Static data, and why it isn't

Configuration..
Reference data..
Data entry..

...are all streams!
Rich domain models
Makes a complex API discoverable
Can present errors at appropriate times & locations
Difficult to implement over an unsympathetic API
Event driven
Requirement for trading apps
Compose over multiple event streams
Scalable
Resilient
Responsive
Responsive to spikes in load
Work within limitations of UI rendering
Expose asynchrony to the user via interaction and UI
Inform user of failures gracefully
Make failure part of the workflow
Recovering from intermittent failures
Accurately reflect current state of the system
Respond to changes in real-time
Lee Campbell & Matt Barrett
https://github.com/AdaptiveConsulting/ReactiveTrader
..can your server produce?
..can your UI show?
..can your users handle?

System initialisation
Eager or lazy loading of data
System availability & health
Event Driven User Interfaces
https://github.com/AdaptiveConsulting/ReactiveTrader
Streaming and Trading
Reactive Trader in action...
Latency, Conflation and Resilience
Reactive Trader in action...
Streams and active domains...
www.WeAreAdaptive.com
http://reactconf.com/feedback.html
Latency
Congestion on the UI
On the wire
Not all old, i.e. latent, prices are the same!
Lower is better, predictable is best
Conflation
Explicitly limiting throughput
Many possible implementations
Introduces latency
@AdaptiveLimited
Full transcript