Menu

Buzzing About Adobe Flex – Part 2

Some useful background information you need to know about Adobe Flex … (which you can find in the Adobe Flex Developer Guide):

About Flash Player 9While Flex applications run in a browser, they take advantage of the Flash Player 9 runtime environment for executing client-side logic, rendering graphics, and playing animation, audio, or video.Flash Player 9 supports a new higher-performance version of ActionScript(ActionScript 3.0) that works in conjunction with the expressiveness innovationsin Flash Player 8.

At the core of the Flex product line is the Flex Software Development Kit (SDK). Flex 2 SDK consists of the Flex framework (class library), the Flex compilers, the debugger, the MXML and ActionScript programming languages, and other utilities. Flex SDK also includes the source code for the core Flex framework class library, enabling you to study the code of the classes as well as customize or extend them for your own use.

About Flex Builder 2Flex Builder is an integrated development environment (IDE) for developing applications with Flex SDK, Flex Data Services, and the Flash Player. The Flex Builder IDE provides tools that help you develop, design, and debug Flex applications, including an integrated incremental compiler and a step-through debugger.

Today I want to have a closer look at the data-binding layer of Adobe and how I can create CRUD-screens.

Working with data servicesFlex is designed to interact with several types of services that provide access to local and remote server-side logic. For example, a Flex application can use AMF to connect to a web service that uses the Simple Object Access Protocol (SOAP), an HTTP URL that returns XML, or for Flex Data Services, a Java object that resides on the same application server as Flex. The MXML components that provide data access are called data service components. MXML includes the following types of data service components:WebService Provides access to SOAP-based web services.HTTPService Provides access to HTTP URLs that return data.RemoteObject Provides access to Java objects (Java Beans, EJBs, POJOs) by using the AMF protocol. This option is only available with Flex Data Services or Macromedia ColdFusion MX 7.0.2.

I need to use the Flex Data Services to be able to add data-bound components into my Adobe Flex Application.

Using the HTTPService – data service component I’m able to integrate an existing rss-feed from a blog to populate a DataGrid-component in my Flex Application. Looks very fancy and it’s not hard to try this out.

Using the WebService – data service component I can call a webservice and get back the results in a datagrid-component. You can learn how to pass parameters into the webservice and how to react when the webservice is calles, e.g. when the user invokes a certain action or when the application has been displayed (e.g. onPageLoad or to say in Flex-language oncreationComplete). You will actually work in the same way as when using the HTTPService only you’re invoking a webservice endpoint instead of a HTTP request.

Data Management Services, chapter 19, discusses the different adapters that are need to use persistent or transient data in an Adobe Flex Application.The ActionScript object Data Management Service adapter persists data in server memory and is useful for applications that require transient distributed data that is not persisted.The Data Management Service Java adapter will be used for data that is persisted to a data store.

I need to download a trial version of LiveCycle Data Services ES , to be able to integrate Data into my Adobe Flex application.

I’ve already tried to create a Database Accessor to my Oracle schema but this doesn’t seem to work regarding a bug reported by Adobe. When you try to create a connection to an oracle db with more than 1 schema, which would be the case for 99% of th time, the data connector can’t establish the connection.

So when you want to create a CRUD-application using Oracle as your db, you need to wait for a patch/new beta release.

What are the pro’s and con’s I’ve seen today:

Pro: integrating a HTTPService, a blog for example, is very straightforward and doesn’t ask any specific modifications or knowledge from the developer (except reading the dev guide ;o) )

Con: renaming the mxml file still holds the old swf- and html-files in the bin-folder, these can be removed manually without any impact on the application

Con: Not able to delete a Database Accessor you’ve defined earlier, not clear how to edit the existing Database Accessor either

Con: Exceptions thrown when having a look at existing , e.g. try to access www.papervision.org twice in a new browser session => the following error is shown:

ArgumentError: Error #2082: Connect failed because the object is alreadyconnected. at flash.net::LocalConnection/connect() atcom.noventaynueve.underwater::Launch() at main() at[execute-queued] at [io]

That’s it for today … I hope I can build a small application using an Oracle database.