composite user interfaces for service oriented systems without exercises

79
Composite UI for Service Oriented Systems Daniel Marbach @danielmarbach bbv Software Services AG

Upload: daniel-marbach

Post on 06-Jul-2015

132 views

Category:

Technology


2 download

DESCRIPTION

Slides for my Composite User Interfaces for Service Oriented Systems workshop.

TRANSCRIPT

Page 1: Composite user interfaces for service oriented systems without exercises

Composite UIfor Service Oriented Systems

Daniel Marbach @danielmarbachbbv Software Services AG

Page 2: Composite user interfaces for service oriented systems without exercises

De CompositionW

hy

How

Why

How

Page 3: Composite user interfaces for service oriented systems without exercises

SystemApplication

Fancy 1.0

Page 4: Composite user interfaces for service oriented systems without exercises

SystemApplication

Fancy 1.0

Page 5: Composite user interfaces for service oriented systems without exercises

The network is reliable

Latency isn’t a problem

Bandwidth isn’t a problem

The network is secure

Topology won’t change

The administrator will know what to do

Transport cost isn’t a problem

The network is homogeneous

The system is atomic/monolithic

The system is finished

Business logic can and should be centralized

Page 6: Composite user interfaces for service oriented systems without exercises

The network is reliable

var svc = new MyService();var result = svc.Process(data);

Page 7: Composite user interfaces for service oriented systems without exercises

Risk analysisInfrastructure and software redundancyReliable messaging

Page 8: Composite user interfaces for service oriented systems without exercises

Latency isn’t a problem

Network

In-Memory

Serialization

Page 9: Composite user interfaces for service oriented systems without exercises

Don’t cross the networkTake all data you might needMinimize chit-chat

Page 10: Composite user interfaces for service oriented systems without exercises

Bandwidth isn’t a problemBigData

Congestion

Page 11: Composite user interfaces for service oriented systems without exercises

Balance eager fetch vs. lazy loadingBalance bandwidth vs. latencySeparate networks

Page 12: Composite user interfaces for service oriented systems without exercises

The network is secure

100% Safety is not possible

Page 13: Composite user interfaces for service oriented systems without exercises

Threat model analysisBalance costs against risksTalk about it

Page 14: Composite user interfaces for service oriented systems without exercises

Topology won’t changeServer down

Server moved

Page 15: Composite user interfaces for service oriented systems without exercises

Don’t hard-codeResilient protocolsDiscoveryChaos Monkey

Page 16: Composite user interfaces for service oriented systems without exercises

The administrator will know what to do Bus factor

Updates

Page 17: Composite user interfaces for service oriented systems without exercises

Automate & Test deploymentDesign for multiple versions runningconcurrentlyAllow part of the system to be takendown

Page 18: Composite user interfaces for service oriented systems without exercises

Transport cost isn’t a problemSerialization

Hardware

Page 19: Composite user interfaces for service oriented systems without exercises

Reduce chit-chatInfrastructure versus development costs

Page 20: Composite user interfaces for service oriented systems without exercises

The network is homogeneous.NET/Java

NoSQL, REST

Page 21: Composite user interfaces for service oriented systems without exercises

Interop is hardBudget for it

Page 22: Composite user interfaces for service oriented systems without exercises

The system is atomic/monolithicNot scalable

Single DB

Ripple effects

Page 23: Composite user interfaces for service oriented systems without exercises

Internal loose couplingModularizeDesign for scale out in advance

Page 24: Composite user interfaces for service oriented systems without exercises

The system is finishedEffort ($/T) “Finished” Rewrite

Original date “never”finished

Page 25: Composite user interfaces for service oriented systems without exercises

Design for maintenanceDesign for upgradesVersioning is hard

Page 26: Composite user interfaces for service oriented systems without exercises

Business logic can and should be centralized

Page 27: Composite user interfaces for service oriented systems without exercises

Logic is distributed, live with itGroup by feature

Page 28: Composite user interfaces for service oriented systems without exercises

Big Ball of MudMonolithic

Page 29: Composite user interfaces for service oriented systems without exercises

CouplingX depends on Y

Page 30: Composite user interfaces for service oriented systems without exercises

Afferent Efferent

who depends on you on who you depend

Page 31: Composite user interfaces for service oriented systems without exercises

Platform Temporal Spatial

Page 32: Composite user interfaces for service oriented systems without exercises

Platform

Interoperability

Using platform dependent protocols- Remoting- Enterprise Services- Datasets over Webservices

Page 33: Composite user interfaces for service oriented systems without exercises

PlatformXML / XSD, JSON, Protocol BufferHTTPWSDL…

Page 34: Composite user interfaces for service oriented systems without exercises

TemporalX depends on Y and processing time of Y directlyinfluences the processing time of X.

Page 35: Composite user interfaces for service oriented systems without exercises

Temporalseparate the inter-service communication in time with pub/sub

Page 36: Composite user interfaces for service oriented systems without exercises

A

MakeCustomerPreferred()

B

Publish updated customer info

Store data

Save customer as preferred

Publish Customer made preferred

Page 37: Composite user interfaces for service oriented systems without exercises

SpatialWhen location not available the system cannotoperate

Page 38: Composite user interfaces for service oriented systems without exercises

SpatialIntroduce logical destinationsLoadbalancingRoute to logical destinations

Page 39: Composite user interfaces for service oriented systems without exercises

MessagingReduces coupling

Addresses some of the fallaciesNo silver bullet

Page 40: Composite user interfaces for service oriented systems without exercises

Use Messaging to transfer packets of data frequently, immediately, reliably, and

asynchronously, using customizable formats.

Asynchronous messaging is fundamentally a pragmatic reaction to the problems of

distributed systems. Sending a message does not require both systems to be up and ready

at the same time. Furthermore, thinking about the communication in an asynchronous

manner forces developers to recognize that working with a remote application is slower,

which encourages design of components with high cohesion (lots of work locally) and low

adhesion (selective work remotely).

Page 41: Composite user interfaces for service oriented systems without exercises

MessagingReduces coupling

(platform, temporal, afferent and efferent)Addresses some of the fallacies

Page 42: Composite user interfaces for service oriented systems without exercises

Throughput

Load

RPC

Messaging

Page 43: Composite user interfaces for service oriented systems without exercises

Receiver

Sends, and keeps on working

Sender

Id

Page 44: Composite user interfaces for service oriented systems without exercises

Id

Receiver

Sender

Id

Outgoing

Incoming

Page 45: Composite user interfaces for service oriented systems without exercises

DBApp

[HTTP] $$ Order

TxCall 1 of 3

Call 2 of 3

Crash

Rollback

Where’s the order!?

Page 46: Composite user interfaces for service oriented systems without exercises

Infra$$ Order

Your code

TX Receive

DBCall 1 of 3

Rollback

Call 2 of 3

Rollback

The order is back in the queue

Invokes

DTC

Enlists

Q

Retry

Page 47: Composite user interfaces for service oriented systems without exercises

DTC is a timebomb

Page 48: Composite user interfaces for service oriented systems without exercises

Bus$$ Order

Your code

Receive

DBCall 1 of 3

Rollback

Call 2 of 3

Rollback

The order is back in the queue

Invokes

Q

Retry

Page 49: Composite user interfaces for service oriented systems without exercises

MessagePayload (Body)

Metadata (Header)%like% HTTP

Page 50: Composite user interfaces for service oriented systems without exercises

Receiver

Return Address Some time in the future

Sender

Return Address

Page 51: Composite user interfaces for service oriented systems without exercises

Receiver

Some time in the future

Sender

Correlation ID

Message ID

Page 52: Composite user interfaces for service oriented systems without exercises

ReceiverSenderReceiver

Receiver

Page 53: Composite user interfaces for service oriented systems without exercises

Ordering

Page 54: Composite user interfaces for service oriented systems without exercises

Messaging Buy-in

Page 55: Composite user interfaces for service oriented systems without exercises

Service

Function, WebService, Class or Database

Set of technologies

Reuse strategy

Of-the-shelve solution

Way to align IT and business

Page 56: Composite user interfaces for service oriented systems without exercises

Business capability

Data &Business Rules

Everythingis contained

Nothing leftover

Page 57: Composite user interfaces for service oriented systems without exercises

Autonomous

Explicit Boundaries

Contract& Schema

Policy Policy

Page 58: Composite user interfaces for service oriented systems without exercises

Data Outside vs. Inside

Page 59: Composite user interfaces for service oriented systems without exercises

Outside Inside

Page 60: Composite user interfaces for service oriented systems without exercises

Unique ID (UUID or with human readable with version)OK to cache

ImmutableValid rangesStable

Rules for sending messages

Page 61: Composite user interfaces for service oriented systems without exercises

Unique ID (UUID or with human readable with version)OK to cache

ImmutableValid rangesStable

Rules for sending messages

Page 62: Composite user interfaces for service oriented systems without exercises

Then Now

Page 63: Composite user interfaces for service oriented systems without exercises

Command Event

Page 64: Composite user interfaces for service oriented systems without exercises

Mashup

Page 65: Composite user interfaces for service oriented systems without exercises

Bringing it together

Page 66: Composite user interfaces for service oriented systems without exercises

Composite Front End

Client/Server/Service

Page 67: Composite user interfaces for service oriented systems without exercises

Portlet

Layout

Inter-portletcommunication

Shell

Single sign-on

UI Logic

Agent

Host

Page 68: Composite user interfaces for service oriented systems without exercises

Other legacy systems

UI

Business Logic

Adaptors

Server logic

Agent

Page 69: Composite user interfaces for service oriented systems without exercises

Challenges you’ll face

Page 70: Composite user interfaces for service oriented systems without exercises

Queries

Responses

Messages to UI

Deployment

Contract sharing

Dependencies

Status bars Dynamic

Page 71: Composite user interfaces for service oriented systems without exercises

QueriesDon’t use messagingUse read modelsDatabases scale well when readonlyJust query it

Page 72: Composite user interfaces for service oriented systems without exercises

ResponsesNever block the UIEvent AggregatorsForget callbacks, they suck!

Page 73: Composite user interfaces for service oriented systems without exercises

Messages to UIDoesn’t need to be 1:1 mappingTask based UI

Page 74: Composite user interfaces for service oriented systems without exercises

Status barsThey never tell the truthTrick the user with some educated guessesUse indeterminate progress bars

Page 75: Composite user interfaces for service oriented systems without exercises

DeploymentKeep it simpleAutomate itVisualize and monitor itConfiguration can be hard, design for it

Page 76: Composite user interfaces for service oriented systems without exercises

Contract sharingFavor loose contracts over interfaces and classesBe pragmatic for compositionIT/OPS defines interfaces, services implement them

Page 77: Composite user interfaces for service oriented systems without exercises

DependenciesSemantic VersioningNuget

Page 78: Composite user interfaces for service oriented systems without exercises

DynamicDon’t go overboard with fancy techniquesSometimes hard-wiring is just fine

Page 79: Composite user interfaces for service oriented systems without exercises

Daniel Marbach [email protected]

twitter: @danielmarbachblog: www.planetgeek.ch

www.bbv.ch/blogOSS lead: Appccelerate / MSpec

user group: www.dotnet-zentral.ch