MACROMEDIA FLEX-GETTING STARTED WITH FLEX Getting Started page 74

Table of Contents

Advertisement

Flex Store component figure
The following figure shows the component type of each object in the object model of the Flex
Store application. The Data Object boxes show which objects contain data object properties.
ShoppingCart
(ActionScript component)
Model
CartView
(MXML component)
View
cartData
variable of type
ShoppingCart
Data Object
ProductThumbnail
(MXML component)
View
dataObject
Data Object
FlexStore
The FlexStore object, the top-level application object, is an MXML file. It contains standard
MXML tags that declare most of the application, and custom MXML tags that declare custom
objects. For the custom tags, this file declares them to use the default namespace.
The FlexStore object also contains some application-level ActionScript code that helps glue the
application together, and Cascading Style Sheet (CSS) definitions. The ActionScript code and
CSS definitions are contained in external files to promote modularity and reusability.
catalog
The catalog object is declared in an
simple object with the sole function of data storage, and it requires no data typing. Compare this
with the ShoppingCart object, which is also in the model tier, but stores and manipulates data.
The data for the catalog object is defined in an external XML file, catalog.xml, which is accessed
using a named web service and the following
<mx:WebService id="catalogWS" serviceName="FlexStoreCatalogWS">
<mx:operation
name="getList"
result="selectedItem=catalogWS.getList.result[0]"
/>
</mx:WebService>
Data could just as easily be accessed using an HTTP service or a server-side Java object that
retrieves data from a remote data source.
74
Chapter 4: Architecting Flex Applications
(MXML Application
(MXML component)
variable
<mx:Model>
FlexStore
object)
View
Thumbnail
View
dataObject
variable
Data Object
tag in the FlexStore.mxml file because it is a
<mx:WebService>
catalog
<mx:Model> tag
Model
ProductDetail
(MXML component)
View
dataObject
variable
Data Object
ShoppingCart
(MXML component)
View
cartData
variable of type
ShoppingCart
Data Object
data service tag:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-GETTING STARTED WITH FLEX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents