Michael Adobe Flex Java 1 London

Post on 09-May-2015

1.920 views 0 download

Transcript of 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

©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

©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

®

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

®

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

Rich User Experiences: Opportunities for internal users

®

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

®

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

NATO

®

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

NATO

®

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

NATO

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

©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

© 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

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

eBanking application

12

97%Flash Player 10 (March 2010)

ADOBE FLEX 4

©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

&

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>

ADOBE FLEX 4

HTTP Request&

WebServices

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)

HTTP

©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>

©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>

AMFPublished in December 2007

XML5000 rows ?1.1Mo 29Ko

ADOBE FLEX 4

Remoting AMF

© 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…

© 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…

© 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.

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

Java and ActionScript value objects

Java VO ActionScript VO

© 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

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()

Remoting

ADOBE FLEX 4

Messaging

© 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

© 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

BEST RIA WORKFLOW

FLASH BUILDER 4FLASH CS5 FLASH CATALYST CS5

DESIGNERS DEVELOPERS

Quick Chat

© 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

AIR pilot

© 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

THE GPS CHIPSET ISSUE

LIFE AS AN EVANGELIST

Real-TimeTracker

ADOBE FLEX 4

Data ManagementServices

© 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

© 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

DataManagement

ADOBE FLEX 4

Model driven development

© 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

© 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

© 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)

Model Driven

Rich Internet Applications

ADOBE AIR 2.0

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

AIR <> JAVANATIVE PROCESS & UDP

Flex and Java developers

Flex and Java developers

Learn a new language ?

FAST and FUN

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

Flex and Java developers

Large-scale systems ?

Leading framework for Enterprise RIA

Adobe J2EE libraries

&

JAVA rockstar

JAVA + FLEX rockstar

© 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

©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