enriqueduvos_partnertalkadobeadobeflashplatformandspringsource
Post on 09-Mar-2016
212 Views
Preview:
DESCRIPTION
TRANSCRIPT
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Expressive. Open. Anywhere.
Adobe Flash Platform
Enrique Duvos
Mgr, Flash Platform Evangelism EMEA
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring / BlazeDS Integration
Enrique Duvos Group Mananger EMEA Flash Platform Evangelism
Jeremy Grelle
Senior Software Engineer Lead of Spring BlazeDS Integration
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Agenda
SpringSource Overview
Flash Platform Overview
Data Services and BlazeDS Overview
Remoting Review
Spring BlazeDS Integration
Demo
Roadmap
Q&A
4
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Why Flex + Spring?
Spring has emerged as the de facto standard for the business tier of Java Enterprise applications.
Spring aims to be agnostic to the chosen client technology.
Flex is the obvious choice when a Spring developer is looking at RIA
Don't have to abandon your server-side Spring investment to move into RIA
4
5
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
The Spring Experience
Spring aims to ease integration of a multitude of Java technologies
A Spring developer is attracted to the “Spring Way” of doing things
Common configuration approach for many disparate technologies
Easy transition from “simple” to “enterprise”
i.e., Local transactions to full-blown JTA requires no code changes
5
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Adobe Flash Platform Architecture
Flex Builder
Flex
Flash Media Server Family
Flash Catalyst
Flash CS4 Professional
Tools to Design and Develop
Clients
Servers
Framework
AMF, XML, JSON, SOAP, RSS, ATOM, etc. HTTP/S, Sockets, RTMP, etc.
Flash Player AIR
Applications, Content and Video
BlazeDS Data Services
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Adobe Flash Platform Architecture
Flex Builder
Flash Player
Flex
Flash Catalyst
Flash CS4 Professional
Tools to Design and Develop
Clients
Servers
Framework
AIR
AMF, XML, JSON, SOAP, RSS, ATOM, etc. HTTP/S, Sockets, RTMP, etc.
Applications, Content and Video
Flash Media Server Family
BlazeDS Data Services
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Adobe Flash Platform
Flex Builder
Flex
Flash Media Server Family
Flash CS4 Professional
Tools to Design and Develop
Clients
Servers/Services
Framework
AMF, XML, JSON, SOAP, RSS, ATOM, etc. HTTP/S, Sockets, RTMP, etc.
Flash Player AIR
Applications, Content and Video
BlazeDS Data Services
Flash Catalyst
9
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
How Flex Works in the Browser
Flex 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
Data Services XML/HTTP
REST
SOAP WS
Browser
Flash Player
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Adobe Flash Platform
Flex Builder
Flex
Flash Media Server Family
Flash CS4 Professional
Tools to Design and Develop
Clients
Servers/Services
Framework
AMF, XML, JSON, SOAP, RSS, ATOM, etc. HTTP/S, Sockets, RTMP, etc.
Flash Player AIR
Applications, Content and Video
BlazeDS Data Services
Flash Catalyst
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Serv
ices
A
dapt
ers
Chan
nels
LiveCycle Data Services
Long Polling
NIO Streaming RTMP NIO Polling
Polling AMF
HTTP
Messaging Proxy
NIO Long Polling
Streaming
Producer Consumer RemoteObject Dataservice
Remoting Data Mgmt
Piggyback
Change Tracking
Data Sync
RPC
AMF
Pub/Sub
Real Time Push PDF
Security
Hibernate ColdFusion SQL
Spring WSRP
JMS Java
Client-side APIs
Server-side Infrastructure
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Serv
ices
A
dapt
ers
Chan
nels
Open Source BlazeDS
Long Polling
NIO Streaming RTMP NIO Polling
Polling AMF
HTTP
Messaging Proxy
NIO Long Polling
Streaming
Producer Consumer RemoteObject Dataservice
Remoting Data Mgmt
Piggyback
Change Tracking
Data Sync
RPC
AMF
Pub/Sub
Real Time Push PDF
Security
Hibernate ColdFusion SQL
Spring WSRP
JMS Java
Client-side APIs
Server-side Infrastructure
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Remoting Service
Enables client applications to remotely invoke methods of objects deployed in your application server
Type information is maintained (see Java - ActionScript data type mapping)
Binary encoding of data (AMF: Action Message Format)
Benefits
Straightforward programming model (avoid double XML transformation)
Significant performance and bandwidth advantages
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Remoting 101
<mx:RemoteObject id="srv" destination="product"/>
<mx:Button label="Get Data" click="srv.getProducts()"/>
<mx:DataGrid dataProvider="{srv.getProducts.lastResult} "/>
remoting-config.xml
<destination id="product">
<properties>
<source>flex.samples.ProductService</source>
</properties>
</destination>
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Class Mapping and Serialization/Deserialization Process
Product.as [RemoteClass(alias="flex.samples.Product")] public class Product {
public var id:int; public var name:String; public var description:String; public var price:Number; public var qtyInStock:int;
}
Product.java
public class Product { private int id;
private String name; private String description;
private double price; private int qtyInStock;
// getters and setters }
RemoteClass annotation provides class mapping information
Without explicit mapping information, Java objects are deserialized into dynamic AS objects, and AS objects are deserialized into Java HashMaps
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Remote Objects Instantiation and Life Cycle
By default, BlazeDS takes care of remote objects instantiation using no-arg constructor
Scope can be request (default), session, or application <destination id="contacts">
<properties>
<source>flex.samples.ProductService</source>
<scope>application</scope>
</properties>
</destination>
Instantiation process can be delegated using factories
In the “old” Spring/BlazeDS integration approach, a SpringFactory was used to let Spring instantiate remote objects with appropriate dependency injection
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Old SpringFactory Approach
services-config.xml <factories>
<factory id="spring" class="flex.samples.factories.SpringFactory"/>
</factories>
remoting-config.xml
<destination id="productService">
<properties>
<factory>spring</factory>
<source>productBean</source>
</properties>
</destination>
18
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring -> Flex
The current path is overly complex
Using the “dependency lookup” approach of the SpringFactory feels antithetical to the “Spring Way”
The burden of configuration is multiplied
Potential for deep integration beyond just remoting is limited
Ultimately acts as a potential barrier to adoption of Flex by the Spring community
18
19
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
The Way Forward
Ideally lower the barrier to adoption of Flex by the Spring community
Configuration using the “Spring Way”
Deeper integration beyond remoting
Make Flex the obvious and easy choice for a Spring-powered RIA
SpringSource and Adobe have formed a joint partnership to turn this idea into reality
19
20
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Open Source Foundation
The foundations of this new integration are available as open source
A new Spring subproject in the web portfolio:
Spring BlazeDS Integration
Focus on integrating the open source BlazeDS with Spring
20
21
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration
Bootstrap the BlazeDS MessageBroker as a Spring-managed bean (no more web.xml MessageBrokerServlet config needed)
Route http-based Flex messages to the MessageBroker through the Spring DispatcherServlet
Expose Spring beans for remoting using typical Spring remoting exporter configuration
Using XML namespace tags or Java annotations
No more remoting-config.xml
21
22
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration - Security
Spring Security integration
Easily enabled through simple XML namespace tags
SpringSecurityLoginManager enables use of Spring Security for Authentication through the Flex API
optionally supports per-client authentication
Gives access to the GrantedAuthorities for conditional UI logic
Destinations (which are just Spring beans) are secured using existing Spring Security Authorization mechanisms
Endpoints can be secured by URL or Endpoint Id
Improved SecurityException translation 22
23
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration - Messaging
Messaging integration
Integration with the BlazeDS MessageService
No more need for messaging-config.xml
Use Spring configuration to manage BlazeDS MessageDestinations
MessageTemplate provides simple server-push capabilities
Adapters provided for Spring JMS and Spring Integration
Allows easy communication from Flex clients to Spring message-driven POJOs
23
24
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration - Advanced Customization
Several hooks are provided for advanced customization
ExceptionTranslator
MessageInterceptor
ManageableComponentFactoryBean
for integrating 3rd-party adapters (i.e., dpHibernate, Gilead)
24
25
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration - Upcoming Features (post-1.0)
Spring 3.0 REST integration Provides support for multiple client-types
Flex apps can already consume Spring 3.0 RESTful endpoints through HTTPService
Additional value could be realized by providing an AMFView implementation
Response for HTTP requests with a Content-Type=application/actionscript
25
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Demo
27
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Spring BlazeDS Integration - Goals
Make the transition to using Flex for developers in the Spring community a smooth and painless experience
Able to migrate portions of your application gradually since the infrastructure does not change
Enable easy support for multiple client types through Spring 3.0’s REST support
Continue using the Spring programming model you’ve come to know and love
27
28
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
LCDS Integration
Build on the open source foundation to provide additional benefit to using LCDS with Spring
A “SpringSource-certified” Add-on to LCDS available as part of SpringSource Enterprise:
SpringSource Adapter for LCDS
28
29
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
LCDS Integration - Upcoming Features
Enable SpringSource Enterprise users to easily take advantage of the advanced data synchronization features of LCDS using their existing service infrastructure
Ensure smooth integration of existing open source features with the LCDS NIO-based SocketServer
29
30
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
LCDS Integration - Upcoming Features (1.0 - May 2009)
LCDS data Assemblers configured as Spring beans
Enables them for declarative transaction control
SpringHibernateAssembler that uses a Spring-managed Hibernate SessionFactory
equivalent assembler for JPA
Declarative adaptation of existing Spring-managed DAOs to the Assembler interface
30
31
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
LCDS Integration - Upcoming Features (post 1.0)
Integration of DataService with Spring’s declarative transaction support
Transactions driven by the LCDS DataService using the Spring PlatformTransactionManager abstraction
Allows transparent migration from local transactions to JTA
Targeted at the next major revision of LCDS
31
32
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
LCDS Integration - Goals
Allow Spring developers who are ready to scale up to take advantage of LCDS while keeping the Spring programming model intact.
Gives you a clear and easy path for the transition, exhibiting the benefits of using LCDS in conjunction with Spring-managed transactional services.
Provides you with a fully certified, indemnified, and supported Enterprise solution.
32
33
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Summary
Flex and Spring together provide a powerful solution for building enterprise class RIAs
BlazeDS provides a proven open source foundation to build on for Flex->Java communication
LCDS takes up where BlazeDS leaves off to provide a first-class supported enterprise solution
Spring BlazeDS Integation and the SpringSource Adapters for Adobe Flex make Flex the obvious and easy choice for building a Spring-powered RIA
33
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
Questions?
top related