This document discusses communication between Java and Flex applications. It provides an overview of Flex and how it works with Java, including using HTTP requests, web services, and messaging between the two platforms. It also covers data management services and model-driven development when combining Java and Flex.
10. Flex/JSP architecture
UI LAYER
Web browser
SERVER XML on HTTP(s) Java servlet container (tomcat, WAS…)
PRESENTATION
/SERVICES/DAO Webapp (WAR)
LAYER
JAVA classes/services
catalog.jsp
ProductService.java public getProducts()
DATABASE/
STORAGE LAYER
WSDL JDBC
2008 Adobe Systems Incorporated. All Rights Reserved.
26. Publish/Subscribe Messaging
LiveCycle DS / Blaze DS
!Client A
Message
Endpoint
Service
!Client B
!RTMP
!Client C
!AMF Publisher
!HTTP Subscriber
44
2008 Adobe Systems Incorporated. All Rights Reserved.
27. Messaging - Data Push
LiveCycle DS / Blaze DS
Messaging
Adapter X
System X
Message JMS
Endpoint JMS Adapter
Services Provider
Messaging
Adapter Y
System Y
!RTMP
!AMF Publisher
!HTTP Subscriber
45
2008 Adobe Systems Incorporated. All Rights Reserved.
28. Channels of LiveCycle Data Services ES
46
2008 Adobe Systems Incorporated. All Rights Reserved.
30. Working with Data
Traditional Page-Centric HTML Model
data data
! Client mostly used as a data capture Persistence Solutions:
and display device
Hibernate
! Client doesn’t own a version of the
data
JDOs
! No client side data manipulation
EJB 3
! Data needs to be synchronized
between middle-tier and data store Others…
75
2005 Adobe Systems Incorporated. All Rights Reserved.
31. RIA Model
data data data
! Client owns a version of the data
! Rich client-side data manipulation
! Data needs to be synchronized between client-tier and middle-tier and
between middle-tier and data store
76
2005 Adobe Systems Incorporated. All Rights Reserved.
32. RPC Approach
RPC
Services
data data
Developer’s Responsibilities:
! Flag changes (create, update, delete)
! Maintain original version of data for appropriate locking
strategy
! Make Remote Procedure Calls for creating, updating,
deleting items
! Identify and handle con icts / concurrency issues
77
2005 Adobe Systems Incorporated. All Rights Reserved.
33. Data Services Approach
Data
Service
data data
Client-Side API:
! Flags changes (create, update, delete)
! Maintains original version of data for appropriate locking
strategy
! Sends list of changes to Data Service as a set of messages
! Handle con icts / concurrency issues
78
2005 Adobe Systems Incorporated. All Rights Reserved.
34. Data Services Approach
Object
Hibernate
Data
Service JDBC
ColdFusion
data data
Custom
Data Service:
! Deserializes list of changes coming from client
! Serializes data before sending to client
! Passes list of changes to con gured adapter
! Noti es clients who subscribed to destination
Adapter:
! Processes changes
! Identi es con icts
! Passes results to Data Service
79
2005 Adobe Systems Incorporated. All Rights Reserved.
35. Data Services
Flex Enterprise Services
JDBC
Client A RDBMS
Adapter
Endpoint Data Object
DAO
Service Adapter
Client B
Hibernate
Hibernate
Adapter
CFC
Client C Adapter ColdFusion
80
2005 Adobe Systems Incorporated. All Rights Reserved.
36. 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
5. Lazy loading
6. Paging
7. Cross-client synchronization
!®
!Copyright 2008 Adobe Systems Incorporated. All rights reserved.
38. 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
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
39. Fiber: LCDS 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
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
40. LCDS Model-Driven Development
!"#$%*'+-7").,5*',#*#$1%"2/$,-
!"#$%&'(')$*5$0-+)$0*',#*')-.8'3-0*4.$9*
!"#$%&#).:$,*8")/06
;"#$*5$,*"8*<".%$)1%'-$*3"#$*4:'%+$* !"#$%&'(')$*)+,-./$0*0+11")-*#2,'/.3*
"<=$3-0>*0-+<0>*$-396 /"#$%*.,-$)1)$-'-.",*4,"*3"#$*5$,*
,$$#$#6
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.
41. LCDS 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)
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved.