Top Banner
© 2010 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Communication between JAVA and FLEX EMEA developer week - 8th of June
49

Eva flex java_1_slides

May 20, 2015

Download

Technology

Michael Chaize

Slides presented at the Adobe EMEA online developer week by Michael Chaize. Flex and JAVA communications with Blaze DS and LCDS.
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: Eva flex java_1_slides

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

Communication between JAVA and FLEXEMEA developer week - 8th of June

Page 2: Eva flex java_1_slides

©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: Eva flex java_1_slides

©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: Eva flex java_1_slides

©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 5: Eva flex java_1_slides

97%Flash Player 10 (March 2010)

Page 6: Eva flex java_1_slides

ADOBE FLEX 4

Page 7: Eva flex java_1_slides

©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 8: Eva flex java_1_slides

&

Page 9: Eva flex java_1_slides
Page 10: Eva flex java_1_slides

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 11: Eva flex java_1_slides

ADOBE FLEX 4

HTTP Request&

WebServices

Page 12: Eva flex java_1_slides

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 13: Eva flex java_1_slides

HTTP

Page 14: Eva flex java_1_slides

©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 15: Eva flex java_1_slides

©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 16: Eva flex java_1_slides

AMFPublished in December 2007

XML5000 rows ?1.1Mo 29Ko

Page 17: Eva flex java_1_slides

ADOBE FLEX 4

Remoting AMF

Page 18: Eva flex java_1_slides

© 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 19: Eva flex java_1_slides

© 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 20: Eva flex java_1_slides

© 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 21: Eva flex java_1_slides

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

Java and ActionScript value objects

Java VO ActionScript VO

Page 22: Eva flex java_1_slides

© 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 23: Eva flex java_1_slides

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 24: Eva flex java_1_slides

Remoting

Page 25: Eva flex java_1_slides

ADOBE FLEX 4

Spring BlazeDS Integration

Page 26: Eva flex java_1_slides

ADOBE FLEX 4

Messaging

Page 27: Eva flex java_1_slides

© 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 28: Eva flex java_1_slides

© 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 29: Eva flex java_1_slides

Quick Chat

Page 30: Eva flex java_1_slides

© 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 31: Eva flex java_1_slides

THE GPS CHIPSET ISSUE

LIFE AS AN EVANGELIST

Page 32: Eva flex java_1_slides

Real-TimeTracker

Page 33: Eva flex java_1_slides

ADOBE FLEX 4

Data ManagementServices

Page 34: Eva flex java_1_slides

© 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 35: Eva flex java_1_slides

© 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 36: Eva flex java_1_slides

DataManagement

Page 37: Eva flex java_1_slides

ADOBE FLEX 4

Model driven development

Page 38: Eva flex java_1_slides

© 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 39: Eva flex java_1_slides

© 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 40: Eva flex java_1_slides

© 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 41: Eva flex java_1_slides

Model Driven

Page 42: Eva flex java_1_slides

Flex and Java developers

Page 43: Eva flex java_1_slides

Flex and Java developers

Learn a new language ?

FAST and FUN

Page 44: Eva flex java_1_slides

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 45: Eva flex java_1_slides

Flex and Java developers

Large-scale systems ?

Leading framework for Enterprise RIA

Adobe J2EE libraries

Page 46: Eva flex java_1_slides

&

Page 47: Eva flex java_1_slides

JAVA rockstar

JAVA + FLEX rockstar

Page 48: Eva flex java_1_slides

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

Flash Platform - A complete system for web innovation

Page 49: Eva flex java_1_slides

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

Feel free to contact me

49

Michaël ChaizeFlash Platform Evangelist

My blog: www.RIAgora.com

@mchaize