Michael Adobe Flex Java 1 London

62
© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Advanced mechanisms between JAVA and FLEX LONDON - 16th of June

Transcript of Michael Adobe Flex Java 1 London

Page 1: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Advanced mechanisms between JAVA and FLEXLONDON - 16th of June

Page 2: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Feel free to contact me

2

Michaël ChaizeFlash Platform Evangelist

My blog: www.RIAgora.com

@mchaize

Page 3: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

4

Applications & User Interfaces in the Enterprise world

MAINFRAME

REA

CH

Local

Global

RICHText UI Integrated Rich GUI

CLIENT/SERVER

WEB APPLICATIONS

2004

1992

1998

RICH INTERNETAPPLICATIONS

Page 4: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 4

Why Do Intuitive User Experiences Ma�er?

ForresterAugust 7, 2009�e State Of Enterprise IT Budgets: 2009by Heidi Lo and Andrew Bartels

Page 5: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 5

Rich User Experiences: Opportunities for internal users

Page 6: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 6

Rich User Experiences: Opportunities for internal users

5 mins 20 secs

Increase productivity & improve decision making

Page 7: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 7

NATO

Page 8: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 8

NATO

Page 9: Michael Adobe Flex Java 1 London

®

Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe con�dential. 9

NATO

From system-centric views, to user-centric applications.

Page 10: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

RIA and technical challenges

• Be�er response time• Light bandwidth• Less load on the server side• Less tests on the client side

Web 1.0 application Rich Internet Application

<page>

<page>

<page>

<page>

<page>

<page>

<page><application>

<data>

SERVER SERVER

CLIENT CLIENT

Page 11: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

All external content and images pending approvals.

�e Flash Platform is the leading solution for rapidly building RIAs

MultiscreenContent and Applications

Flex

ColdFusion

Flash Media Server Family

Flash PlatformServices

AIR

Flash Player

Flash Builder

FlashCatalyst

FlashProfessional

Creative Suite Analytics &Optimization

FLA

SH P

LATF

ORM

TOOLS FRAMEWORK CLIENTSSERVICESSERVERS

LiveCycle

Page 12: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

eBanking application

12

Page 13: Michael Adobe Flex Java 1 London

97%Flash Player 10 (March 2010)

Page 14: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

Page 15: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

What is Flex and how it works

Flash Builder IDE

Flex SDK

Flex Class Library

MXML ActionScript

Compile

SOAP HTTP/S AMF/S RTMP/S

Web Server

Existing Applications & Infrastructure

J2EE Application Server

LC Data ServicesXML/HTTP

REST

SOAP Web Services

Browser

Flash Player

Page 16: Michael Adobe Flex Java 1 London

&

Page 17: Michael Adobe Flex Java 1 London
Page 18: Michael Adobe Flex Java 1 London

AdobeEvent.java

JAVA VALUE OBJECT

int idEventint idUserString evtNameString evtCityString evtCountryint evtAudienceint evtDate

EventService.java

JAVA SERVICE CLASS

List getEvents()AdobeEvent getEvent(idEvent)AdobeEvent getEventbyIDUser(idUser)List getActivityByuser()boolean update(event)boolean remove(event)boolean deleteEvent(event)

AdobeActivityEvent.java

JAVA VALUE OBJECT

int idUserString userNameint nbEvents

TABLES

DATABASE

adobeusersadobevents

listEvents.jsp

JAVA SERVER PAGE

<activity><adobeEvent></adobeEvent><adobeEvent></adobeEvent>

</activity>

Page 19: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

HTTP Request&

WebServices

Page 20: Michael Adobe Flex Java 1 London

2008 Adobe Systems Incorporated. All Rights Reserved.

Flex/JSP architecture

UI LAYER

SERVERPRESENTATION/SERVICES/DAOLAYER

DATABASE/STORAGE LAYER

listEvents.jsp

Java servlet container (tomcat, WAS…)

JDBC

Web browser

JAVA classes/services

Webapp (WAR)

EventService.java public getEvents()

WSDL

XML on HTTP(s)

Page 21: Michael Adobe Flex Java 1 London

HTTP

Page 22: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

! Same with PHP, Ruby, Perl, ASP...

! Returns XML, text, tabulated text, JSON...

! Use send() to launch the request

! Result and Fault events

! New data-services wizard in Flash Builder 4 to generate a STUB on the client side

Flex and <HTTPRequest>

Page 23: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

! Web Services Description Language 1.1 (WSDL 1.1) document

! �e Flex web service API generally supports Simple Object Access Protocol (SOAP) 1.1, XML Schema 1.0, and WSDL 1.1 RPC-encoded, RPC-literal, and document-literal (bare and wrapped style parameters).

! Flex supports web service requests and results that are forma�ed as SOAP messages

Flex and <Webservice>

Page 24: Michael Adobe Flex Java 1 London

AMFPublished in December 2007

XML5000 rows ?1.1Mo 29Ko

Page 25: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

Remoting AMF

Page 26: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

LiveCycle Data Services ES

LiveCycle Data Services is a set of Java EE components and APIs used to:

Create data-intensive RIAs with less code, less risk, and accelerated time to market due to an innovative client-server programming model

Integrate RIAs with existing applications, back-end data, and JEE infrastructure

Easily integrate RIAs with LiveCycle document and process services

Enable collaboration, o�ine AIR and real-time data streaming applications to be built in a scalable and reliable manner with robust publish and subscribe messaging

Generate PDF documents from RIAs that include graphical assets

LiveCycle Data Services ES

Data Management

RPC Services

Messaging

ServiceAdapters

Data Synchronization

O�-line Applications

Data Paging

Web Service

HTTP Service

Remote Object Service

Publish & Subscribe

Collaboration

Real Time Data Push

Proxy Service

Web-tier Compiler

Portal Deployment

RIA-PDF Generation

LiveCycle

ColdFusion

Hibernate

SQL

JMS

Java

Custom…

Page 27: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Blaze DS

BlazeDS is a set of Java EE components and APIs, and a subset of LiveCycle Data Services:

- Free and open source.

- High performance data transfer for more responsive applications using AMF

- Real-time server push over standard HTTP

- Full pub/sub messaging that extends existing messaging infrastructure

LiveCycle Data Services ES

Data Management

RPC Services

Messaging

ServiceAdapters

Data Synchronization

O�-line Applications

Data Paging

Web Service

HTTP Service

Remote Object Service

Publish & Subscribe

Collaboration

Real Time Data Push

Proxy Service

Web-tier Compiler

Portal Deployment

RIA-PDF Generation

LiveCycle

ColdFusion

Hibernate

SQL

JMS

Java

Custom…

Page 28: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

LCDS.war

! Structure of the WAR �le:

! +WEB-INF/classes To place your Java classes

! +WEB-INF/lib Hosts the JAVA libraries of LCDS

! +WEB-INF/�ex Hosts the XML con�guration �les! Remoting-con�g.xml Destinations to Java classes for remoting

! Messaging-con�g.xml Destinations for messaging

! Data-Management-con�g.xml Destinations to Java assemblers

! Proxy-con�g.xml Destinations to HTTP services

! Services-con�g.xml Channels con�gurations

A �le named « LCDS.war » is provided to start your Flex/Java projects.

Page 29: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Java and ActionScript value objects

Java VO ActionScript VO

Page 30: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Java and ActionScript types

STRING STRING

BOOLEAN BOOLEAN

INT, SHORT, BYTE INT

DOUBLE, FLOAT, LONG NUMBER

CALENDAR, DATE DATE

OBJECT OBJECT

COLLECTION ARRAYCOLLECTION

OBJECT[] ARRAY

ORG.W3C.DOCUMENT XML OBJECT

NULL NULL

Page 31: Michael Adobe Flex Java 1 London

2008 Adobe Systems Incorporated. All Rights Reserved.

Flex/Java classic architecture

UI LAYER

SERVERPRESENTATION/SERVICES/DAOLAYER

DATABASE/STORAGE LAYER

LiveCycle Data Services

Java servlet container (tomcat, WAS…)

JDBC

Web browser

JAVA classes/services

Webapp (WAR)

RPC services Messaging Data Mgt

WSDL

AMF over HTTPs

JAVA <-> AMF

EventService.java public getEvents()

Page 32: Michael Adobe Flex Java 1 London

Remoting

Page 33: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

Messaging

Page 34: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Channels

Flex client

Servlet-based endpoints

AMF Endpoint

HTTPEndpoint

StreamingAMFEndpoint

NIO-based endpoints

NIOAMFEndpoint

NIOHTTPEndpoint

RTMPEndpoint

MessageBrokerServlet

Socket Server (LCDS only)

MessageBroker

Remoting

HTTPProxy

Message

Data Management

Page 35: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Publish/Subscribe Messaging

Message

Service

LiveCycle DS / Blaze DS

Endpoint

PublisherSubscriber

!RTMP

!AMF

!HTTP

!Client A

!Client B

!Client C

Page 36: Michael Adobe Flex Java 1 London

BEST RIA WORKFLOW

FLASH BUILDER 4FLASH CS5 FLASH CATALYST CS5

DESIGNERS DEVELOPERS

Page 37: Michael Adobe Flex Java 1 London

Quick Chat

Page 38: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Publish/Subscribe Messaging : private messages

Message

Service

LiveCycle DS / Blaze DS

Endpoint

PublisherSubscriber

!RTMP

!AMF

!HTTP

!Client A

!Client B

!Client C

to clientA

Page 39: Michael Adobe Flex Java 1 London

AIR pilot

Page 40: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Data Push - Messaging

Message

Services

LiveCycle DS / Blaze DS

Adapter Y

Adapter X

Messaging

System Y

Messaging

System X

EndpointJMS

ProviderJMS Adapter

PublisherSubscriber

!RTMP

!AMF

!HTTP

Page 41: Michael Adobe Flex Java 1 London

THE GPS CHIPSET ISSUE

LIFE AS AN EVANGELIST

Page 42: Michael Adobe Flex Java 1 London

Real-TimeTracker

Page 43: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

Data ManagementServices

Page 44: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Data Management Services

LiveCycle Data Services

DataService

DAOObjectAdapter

HibernateAdapter

JDBCAdapter

Hibernate

RDBMS

CFCAdapter ColdFusion

Endpoint

Client A

Client B

Client C

Page 45: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Data Management Bene�ts

1. Automatic Client to Middle-Tier Synchronization

! Change Tracking

! Automatic invocation of remote services

2. Highlander Principle: there is only one instance of a given entity in memory at any given time

3. Con�ict resolution

4. O�ine Synchronization (thanks to Adobe AIR)

5. Lazy loading

6. Paging

7. Cross-client synchronization

Page 46: Michael Adobe Flex Java 1 London

DataManagement

Page 47: Michael Adobe Flex Java 1 London

ADOBE FLEX 4

Model driven development

Page 48: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Code Driven Development

Code •UI controls / formatters / styles• Calculated �elds• Validation Rules• Variants (conditional properties)• Localization• Security• Data Retrieval Logic (paging, lazy loading)• Data Synchronization Logic

Model •Basic Data Description

Model Server-side code Client-side code

Page 49: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Model Driven Development

Code• Ad-hoc customization• View composition• External business/validation logic

Model • Rich data model (data and behaviors)• Calculated �elds• Validation Rules• Variants (conditional properties)• Localization• Security• UI hints/defaults: controls, formatters, styles

Model includes enough information to derive data retrieval, persistence, and synchronization logic

Model Server-side code Client-side code

Page 50: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Model Driven Development Bene�ts

Productivity: Less code to write

! No persistence code or data sync code

! Value objects and service stubs are automatically generated

Maintainability: Less code to maintain

! Changes to the model are automatically propagated

Consistency

! Between client and server (for example, constraints and validation rules are de�ned in the model, not duplicated using di�erent languages in the client and the server)

! Across views (for example, UI controls, styles, and validation rules are de�ned in the model, not duplicated across di�erent views)

Approachability

! No code to write to implement complex capabilities such as persistence, synchronization, paging, lazy loading, o�ine, etc.

Innovation:

! O�ine and client synchronization capabilities

! Model is language independent and can be leveraged by di�erent client technologies and tools (Flex, PDF, etc)

Page 51: Michael Adobe Flex Java 1 London

Model Driven

Page 52: Michael Adobe Flex Java 1 London

Rich Internet Applications

Page 53: Michael Adobe Flex Java 1 London

ADOBE AIR 2.0

Out of the browserO�ine/Online sync (salesForce)Invoke OS Native ProcessesEmbed your own Java librariesSoon on smartphones

Page 54: Michael Adobe Flex Java 1 London

AIR <> JAVANATIVE PROCESS & UDP

Page 55: Michael Adobe Flex Java 1 London

Flex and Java developers

Page 56: Michael Adobe Flex Java 1 London

Flex and Java developers

Learn a new language ?

FAST and FUN

Page 57: Michael Adobe Flex Java 1 London

Flex and Java developers

Agile development ?

Keep your tools and methodologies

JavaUnit and FlexUnitJavaPMD and FlexPMD

MAVEN, ANTMVC frameworks

Hudson, Sonar reportsFlexCover, FlexCPD, load tests

Page 58: Michael Adobe Flex Java 1 London

Flex and Java developers

Large-scale systems ?

Leading framework for Enterprise RIA

Adobe J2EE libraries

Page 59: Michael Adobe Flex Java 1 London

&

Page 60: Michael Adobe Flex Java 1 London

JAVA rockstar

JAVA + FLEX rockstar

Page 61: Michael Adobe Flex Java 1 London

© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

All external content and images pending approvals.

�e Flash Platform is the leading solution for rapidly building RIAs

MultiscreenContent and Applications

Flex

ColdFusion

Flash Media Server Family

Flash PlatformServices

AIR

Flash Player

Flash Builder

FlashCatalyst

FlashProfessional

Creative Suite Analytics &Optimization

FLA

SH P

LATF

ORM

TOOLS FRAMEWORK CLIENTSSERVICESSERVERS

LiveCycle

Page 62: Michael Adobe Flex Java 1 London

©2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Con�dential.

Feel free to contact me

62

Michaël ChaizeFlash Platform Evangelist

My blog: www.RIAgora.com

@mchaize