Top Banner
1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.
36

1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

Dec 29, 2015

Download

Documents

Kathleen Small
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

1

Model-Driven Integration Strategies

Joe Berkovitz

Chief Architect, Allurent Inc.

Page 2: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

2

This talk is about…

Modelling: describing software abstractly

Integration: hooking up disparate components

Strategy: an overarching approach to a problem

Model-Driven Integration Strategy:An approach that uses abstract descriptions to drive the hookup of disparate components

Page 3: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

3

Who…

…is using SOAP web services?

…is using HTTP/XML services?

…is using RemoteObject

…is using Flex Data Services?

…is using Flash Remoting?

…is using Cairngorm?

…is using custom transport/serialization?

Page 4: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

4

Who hates writing burdensome,repetitive, error-prone code?

Page 5: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

5

The Integration Problem

Many strongly-related components and assets Value Objects

Services with VO params that return more VOs

Multiple language bindings for VOs, Services

VO Serializers and Deserializers

User Documentation

Metadata

Page 6: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

6

The Integration Problem

Many languages in play ActionScript 2

ActionScript 3

MXML

Java

C#

XSD

WSDL

Page 7: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

7

The Integration Problem

Many transport technologies SOAP Web Services

Axis

.NET

REST Web Services

XMLRPC

Flash Remoting

Flex Data Management Services

Random Custom Stuff

Page 8: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

8

Controller

My real (ugly) worldFlex Client

SOAP web services

CatalogService

OrderService

Views

SOAP/XML

ValueObjects

REST/XML

integration layer

Commerce APIs

REST web services

data access layer JavaModel

WSDL

CatalogDB

Catalog Server Commerce Server

Documentation

Process Support

VO, ServiceMetadataXML Marshaller

Page 9: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

9

Controller

Commonalities

SOAP web services

CatalogService

OrderService

Views

integration layer

Commerce APIs

REST web services

data access layer JavaModel

WSDL

CatalogDB

Catalog Server Commerce Server

Documentation

Process Support

ValueObjects

Flex Client

VO, ServiceMetadataXML Marshaller

Page 10: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

10

Commonalities (continued)

Many components encode the same information or overlap heavily

Variations: role

syntax

structure

degree of detail

Page 11: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

11

Transformation Tools

In limited realms, transformation tools are popular

They reduce the number of parallel representations

Example: Axis WSDL2Java (.NET similar)

SOAP web services JavaModel

WSDL

WSDL2Java

Page 12: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

12

or….. Java2WSDL!

SOAP web services JavaModel

WSDL

Java2WSDL

Page 13: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

13

Existing transformation tools are limited

Axis, .NET stay within their platform boundaries

xdoclet, xdoclet2 rely on annotation of Java classes, interfaces: locks into standard OOP language model

XSLT doesn't work so well for very complex iterative transforms, and has limited programmability (for non-masochists)

Page 14: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

14

Where transformations help

Across technology domains: same concept, different languages/protocols

Within technology domain: interlocking concepts, same language

Page 15: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

15

Output FilesOutput Files

GeneratorsGenerators

What Hamachi does

Language-neutral XML model description…

…is parsed according to Metamodel into an in-memory model…

…Generators pass parts of that model…

…to Velocity templates to format them into output files

Hamachi

Metamodel Generators

ModelDescription

Output Filestemplates

Page 16: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

16

Output FilesOutput Files

GeneratorsGenerators

Hamachi modules

Different projects need different models, different templates

Hamachi modules package the part that varies:

Hamachi

Metamodel Generators

ModelDescription

Output Filestemplates

Module

Page 17: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

17

Harnessing Generation with Hamachi

CatalogService

OrderService

Documentation

Process Support

Hamachi

SOAP web services JavaModel

WSDL

WSDL2Java

ModelDescription

ValueObjects

VO, ServiceMetadata

Page 18: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

18

Derived Assets for a Single Object

OrderService:OrderItemSummary addToCart()

OrderItemSummary.as

OrderItemSummary.html

Hamachi

addToCart WS endpoint OrderItemSummary.java

<complexType name="OrderItemSummary"/><wsdl:operation name="addToCart">

WSDL2Java

<ClientModelTypename=

"OrderItemSummary">

new ClassDescriptor("OrderItemSummary")

Page 19: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

19

What is a metamodel?

Models describe parts of your application OrderItemSummary is a ClientModelType in the model

OrderItemSummary.price is a Property in the model of type decimal

CatalogService is a ClientService in the model

Metamodels describe parts of your model: ClientModelType is a Class in the metamodel

ClientModelType.properties is a Property of type PropertyList

Page 20: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

20

Page 21: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

21

Page 22: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

22

Adding an Attribute to the ARC Model

Page 23: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

23

Model-Driven SOAP Support

Page 24: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

24

Why not just use <mx:WebService>?

Operations and request/response not strongly typed

No access to returned SOAP fault information

High overhead from parsing WSDL

Performance penalty for generality of SOAP document type support

Page 25: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

25

Model-Driven MVCS SOAP support

IOrderService:type-safe Service interface

OrderItemSummary.as

new ClassDescriptor("OrderItemSummary")

OrderService:Service Implementation

AddToCartOperation:Operation Implementation

SOAP Marshaller/Unmarshaller

Controller

SOAP/XML(follows document/literal

conventions only)

per-class metadata

drives XML parsing/

generation

populate value objectfrom response

invoke API to obtain operation

Order line item view

change eventscause data binding

update in view

executeoperation

create operation

Page 26: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

26

Model-Driven REST Support

Page 27: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

27

REST: accessing a data web

Each distinct entity is served from a stable URL

All relationships are represented as hyperlinks

A relationship may be: lazy (only a hyperlink in referent)

eager (target object details included in referent)

anywhere in between

Very suitable for read-only data

Page 28: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

28

REST data web

<Category uri="/cat/1" name="Widgets"> <products> <Product uri="/product/11" title="Cool Widget"/>

<Product uri="/product/12" title="Cooler Widget"/> </products></Category>

http://example.com/cat/1:

<Product uri="/product/11" title="Cool Widget" price="33.00"> <images> <Asset type="large" href="/images/11large.png"> <Asset type="small" href="/images/11small.png"> </images></Product>

http://example.com/product/11:

<Product uri="/product/11" title="Cooler Widget" price="66.00"> <images> <Asset type="large" href="/images/12large.png"> </images></Product>

http://example.com/product/12:

Page 29: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

29

ContentService:REST entity cache

Product.as

new ClassDescriptor("Product")

REST Unmarshaller

Controller

impl-dependentREST/XML

document format

per-class metadata

drives XML parsing/

generation

create/populateentity instances

request entity by URIon behalf of view

Product display view

change eventscause data bindingupdate in view

Model-Driven MVCS REST support

request formissing propertytriggers loading

populate objectsfrom XML responses

load entitieson demand

Category.as

Page 30: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

30

OzoneLayer:model-driven client/client

integration

Page 31: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

31

Conventional single-user outliner app

modifications

Flex Client

OutlineView

actionsdata,events

IOutlineController

OutlineController

Outline

IOutline

Page 32: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

32

Add OzoneLayer and stir: multiuser outliner

OutlineControllerProxy

Flex Client

OutlineView

actionsdata,events

IOutlineController

OutlineController

SharedScope

Flash Media Server(or moral equivalent)

Shared Object Services

Outline

IOutline

OutlineProxymod

ificati

on

s OutlineControllerProxy

Flex Client

OutlineView

actionsdata,events

IOutlineController

OutlineController

SharedScope Outline

IOutline

OutlineProxymod

ificati

on

s

Page 33: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

33

OzoneLayer: What Hamachi generates

OutlineControllerProxy

Flex Client

OutlineView

actionsdata,events

IOutlineController

OutlineController

SharedScope Outline

IOutline

OutlineProxymod

ificati

on

s OutlineControllerProxy

Flex Client

OutlineView

actionsdata,events

IOutlineController

OutlineController

SharedScope Outline

IOutline

OutlineProxymod

ificati

on

s

Page 34: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

34

Pros

+ One change in model expresses many in system

+ Eliminates many tedious, error-prone changes

+ Enabling technology for custom networking approaches

+ Change to module can affect the "way it works" with no distrubance to the model

Page 35: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

35

Cons

- Longer "curve to liftoff"

- More complex system, harder to learn

- Models, metamodels not fully standardized

Page 36: 1 Model-Driven Integration Strategies Joe Berkovitz Chief Architect, Allurent Inc.

36

Some caveats

Approaches, not turnkey tools

Not all source code available yet

Limited documentation