The object model defines how the various parts of the application map to individual objects. It is useful to think in terms of a model-view-controller (MVC) architecture, and consider whether a particular object is part of the model, view, or controller tier. The MVC design pattern decouples data access, business logic, and data presentation and user interaction.
The following sections describe the object model of the Flex Store application.
The following figure shows the object model for the Flex Store application and identifies each object as part of the model, view, or controller:
The FlexStore object is the top-level object in the Flex Store application. It contains the rest of the application objects, including the standard Flex objects and custom objects. This object is a view object because it is the top-level object in the user interface, but it also contains the rest of the application.
The catalog object is a nonvisual object that contains data about the products available for purchase. This object is a model object because its primary purpose is to represent products.
The ShoppingCart object is a nonvisual object that stores items a user selects for purchase. This object is a model object because its primary purpose is to represent a set of items that the user selects for purchase. It also keeps track of the number of items selected for purchase and the total cost of the items.
The CartView object is a visual object that displays the current ShoppingCart items in the user interface. This object must get the current data from the ShoppingCart object and display it appropriately in the user interface; this requirement is described in Determining component types and a messaging strategy.
The ProductThumbnail object is a visual object that displays a thumbnail image, name, and price for each product in the catalog object.
The ThumbnailView object is a visual object that displays a set of ProductThumbnail objects.
This object must get the product data from the catalog object and pass it into ProductThumbnail objects that represent the individual products contained in the catalog object. This requirement are described in Determining component types and a messaging strategy.
The ProductDetail object is a visual object that displays a large image, name, price, description, and quantity selector for a selected ProductThumbnail object or a selected item in the ShoppingCart object. This object also lets the user add a selected item to the ShoppingCart object.
This object must get the index of the selected ProductThumbnail or ShoppingCart item and display the corresponding product data appropriately in the user interface; this requirement is described in Determining component types and a messaging strategy.
The Checkout object is a visual object that contains a form for placing an order based on the current items in a ShoppingCart object. This object must get the current data from the ShoppingCart object and display it appropriately in the user interface; this requirement is described in Determining component types and a messaging strategy.
Version 1.5
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00000078.htm