Flex & Java

advertisement
Flex & Java
Agenda
• Flex overview
(AS3 VM, Flex Framework, State management)
• Basic integration methods
(Webservice invocation, REST invocation)
• Comfortable integration methods
(RPC, Messaging, Event Driven Architecture)
• Demo
• Making the configuration easy
(Spring Actionscript)
• Demo
• Opensource tools for life
(WebOrb, GraniteDS, AMFPhp, BlazeDS
• Q&A
Flex overview
•
http://www.adobe.com/devnet/actionscript/articles/atp_ria_guide.html
Flex overview
Flex Controls
http://zdrojak.root.cz/clanky/flex-4-zaciname/
1.
2.
3.
4.
5.
1) Player events are dispatched – This includes events dispatched by
the Timer, Mouse, ENTER_FRAMEs, URLLoader, etc…
2) User code is executed – Any code listening to events dispatched by
step 1 are executed at this stage.
3) RENDER event is dispatched – This special event is dispatched
when the user calls stage.invalidate() during normal user code
operation.
4) Final user code is executed – User code listening specifically for
step 3 is executed at this point.
5) Player renders changes to the display list.
Flex libs
•
AS3 Data Structures For Game Developers (AS3DS)
http://lab.polygonal.de/ds/
•
AS3 commons
http://code.google.com/p/as3-commons/
•
AS3 signals
http://github.com/robertpenner/as3-signals
•
AS3 crypto
http://code.google.com/p/as3crypto/
•
FlexMojos (Maven plugin)
http://code.google.com/p/flex-mojos/
•
Papervision 3D
http://blog.papervision3d.org/
•
Away3D
http://away3d.com/
•
Five3D
http://five3d.mathieu-badimon.com/
Design (zamysleny ;)
Flex overview / demo setup
Server side
• Tomcat 6 server
• Java WTP
• Spring 3
• Spring Flex
extension
• Adobe BlazeDS 4
Client side
• Flash Builder 4
• Flex 4 SDK
• Flash Player 10
• Spring ActionScript
• FlexMojos 3 Maven
extension
Basic integration methods
HTTPService
•
<mx:HTTPService
– Properties
• concurrency="multiple|single|last“
• contentType="application/x-www-form-urlencoded|application/xml"
• destination="DefaultHTTP"
• id="No default.”
• method="GET|POST|HEAD|OPTIONS|PUT|TRACE|DELETE"
• resultFormat="object|array|xml|e4x|flashvars|text“
• showBusyCursor="false|true“
• makeObjectsBindable="false|true"
• url="No default."
• useProxy="false|true"
• xmlEncode="No default."
• xmlDecode="No default."
– Events
• fault="No default."
• result="No default." />
Basic integration methods
Webservice
•
<mx:WebService
– Properties
• concurrency="multiple|single|last"
• destination="No default."
• id="No default."
• serviceName="No default."
• showBusyCursor="false|true"
• makeObjectsBindable="false|true"
• useProxy="false|true"
• wsdl="No default."
– Events
• fault="No default."
• result="No default." />
•
<mx:operation
– Properties
• concurrency="multiple|single|last"
• name=No default, required.
• resultFormat="object|xml|e4x"
• makeObjectsBindable="false|true"
– Events
• fault=No default.
• result=No default. />
Comfortable integration methods
RemoteObject
•
•
<mx:RemoteObject
– Properties
• concurrency="multiple|single|last"
• destination="No default."
• id="No default."
• endpoint="No default."
• showBusyCursor="false|true"
• source="No default." (currently, Adobe ColdFusion only)
• makeObjectsBindable="false|true"
– Events
• fault="No default."
• result="No default." />
<mx:method
– Properties
• concurrency="multiple|single|last"
• name="No default, required."
• makeObjectsBindable="false|true"
– Events
• fault="No default."
• result="No default." />
Comfortable integration methods
Publish/Subscribe
• <mx:Consumer
– Properties
•
•
•
•
resubscribeAttempts="5“
resubscribeInterval="5000"
selector="No default."
timestamp="No default." />
• <mx:Producer
– Properties
• defaultHeaders="No default." />
Data types
Convesion
Data types
Convesion
• WebOrb
http://www.themidnightcoders.com/products/web
orb-for-java/overview.html
• GraniteDS
http://www.graniteds.org/
• AMFPhp
http://amfphp.sourceforge.net/
• BlazeDS
http://opensource.adobe.com/wiki/display/blazed
s/BlazeDS/
Backup slides
• Tamarin is the code name used for Adobe’s
virtual machines that
• implement ActionScript 3 (AS3) [1], a flavor of
ECMAScript [11].
• JavaScript is also a flavor of ECMAScript,
however AS3 supports
• multiple constructs that JavaScript does not,
such as optional static
• typing, packages, classes, and early binding.
Download