Introduction to Flex 2

Download Report

Transcript Introduction to Flex 2

Prepared by Stephen Olaño
June 12, 2007
Rich Internet Applications
 It allow to build rich applications with data and
multimedia contents, offering a high interactivity
level.
 RIA is the fusion of the interactive and multimedia
user interface functionality of desktop applications
with traditional WebApps.
 Under the use of the client plug-in you will develop
your WebApps one time and no one time per client
system
Rich Internet Applications
Characteristics
 Expressiveness
 Rich media integration
 Performance / Responsiveness
 Real time
 Offline
 Deep back-end integration
 Web deployment model
Traditional WebApps problems
Process problems: complex WebApps often require
that the user navigates through a series of pages to
complete a single task
2. Data Problems: they do not support interactive
explorations of the data
3. Feedback Problems: they do not allow a continued
and ordered interaction without page refreshments
4. Configuration problems: many Web applications
require the configuration of a product/system from
multicriteria choices
1.
RIA Benefits
What is Flex 2?
 Flex 2 Application
 Built with the Flex Framework 2
 Interface defined via MXML
 Logic implemented using ActionScript 3
 Client-side, deployed as Flash .swf
 Requires Flash Player 9 to view
 Look and Feel are defined using CSS
Flex 2 Framework
 MXML (Macromedia XML)
 Declarative language to define User Interface
 Similar to XHTML
 User Interface Components
 Buttons, ComboBoxes, Layout Managers, Containers,
Effects
 Class Libraries
 Everything in the mx.* packages
 Validation Routines, Web Services, DataTypes
Flex 2 Class library
Flex Architecture
How Flex works
Flex 2 Product Line
Flex Builder 2
 Integrated Development Environment (IDE)
 Edit MXML
 Edit ActionScript
 Built on top of the Eclipse Platform
 Pluggable architecture for anything and everything
 Killer features





Integrated compiler
Code hints
Debugger
Design View
Integrated Version Control (CVS, SVN, etc.)
LiveCycle Data Services
 Formerly “Flex Data Services” or FDS
LiveCycle Data Services
Architecture
RPC Services by LDS
 WebService - The WebService component can be
used to access any Web service that complies with
the WSDL 1.1 standard
 HTTPService — The HTTPService component can
send HTTP GET, POST, HEAD, OPTIONS, PUT,
TRACE, or DELETE requests. It does not support
multi-part requests.
 RemoteObjects — The RemoteObject component
uses Action Message Format (AMF) to transfer data
that is a binary format and is the fastest of the RPC
Services.
Flex Compiler
 mxmlc
 Converts .mxml into ActionScript code
 Compiles ActionScript code to .swf
 compc
 Similar to mxmlc
 Used to create libraries


.swc archives
Similar to Java .jar files
ActionScript 3
 Core of the Flex Framework
 100% ECMAScript 4 compliant
 Standard is still being written
 Flash Player Engineers are part of standard committee
 Similar to ActionScript 2, but..
 Much much (much) faster
 Just-in-time compiled to native machine code
 Powerful new features
 Native Regular Expression support
 E4X syntax makes working with XML easy
ActionScript 3 Basics
 Familiar syntax
 Similar to C++, Java, C#, JavaScript
 Dynamic Language, Weak Typing
 Similar to ColdFusion
 Variables can hold any type
 Support for Strong Typing
 Can bind variable to specific data type
 Faster code execution
 Easier to develop
 More help from compiler
 Easier to find bugs via Flash Debug Player and type errors
MXML Sample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center" verticalAlign="center">
<mx:Button id="myButton" label="I'm a button!" />
</mx:Application>
Sample Output:
ActionScript sample
package com.company.sample {
public class MyClass implements MyInterface {
public var firstname:String;
public var lastname:String;
public var email:String;
public function doSomething():void {
try {
} catch (e:Exception) {
}
}
}
}
Flash Player 9
 New World Class Virtual Machine
- Performance (JIT Compiler)
- Reduced memory consumption
 ActionScript 3
- Standard compliant (ECMAScript4)
- Strong and dynamic typing
- Runtime Error checking
- ECMAScript for XML (E4X)
 Seamless Deployment
- One-click upgrade
- Full backward compatibility
Flash Player Penetration
 Flash content reaches 98% of Internet viewers
 Adobe® Flash® Player is the world's most pervasive software
platform, reaching 98% of Internet-enabled desktops in
mature markets as well as a wide range of devices.
Flex 2 Charting
 Part of the Flex Framework 2, but technically a
separate “product”
 Provides data visualization components
 Pie Charts, Bar Charts, Area Charts, etc.
 Made to integrate seamlessly with FES2
 Remotely synchronized data
 “Shared dashboard”
Flex 2 and AJAX together
Flex and AJAX can
communicate thru
FABridge Library
(Comes with FDS)
That’s all folks!
If you have comments and suggestions about this presentation slides, pls
contact me at [email protected]. Thanks!