Specifications
4
CHAPTER 1
Many types of design patterns have been catalogued and documented. For example, the Functional design pattern
specifies that each module of your application performs a single action, with little or no side effects for the other
modules in your application. The design pattern does not specify what a module is, commonly though it corre-
sponds to a class or method.
About MVC
The goal of the Model-View-Controller (MVC) architecture is that by creating components with a well-defined
and limited scope in your application, you increase the reusability of the components and improve the maintain-
ability of the overall system. Using the MVC architecture, you can partition your system into three categories of
components:
Model components Encapsulates data and behaviors related to the data processed by the application. The model
might represent an address, the contents of a shopping cart, or the description of a product.
View components Defines your application’s user interface, and the user’s view of application data. The view
might contain a form for entering an address, a DataGrid control for showing the contents of a shopping cart, or
an image of a product.
Controller components Handles data interconnectivity in your application. The Controller provides application
management and the business logic of the application. The Controller does not necessarily have any knowledge
of the View or the Model.
For example, with the MVC design, you could implement a data-entry form that has three distinct pieces:
• The model consists of XML data files or the remote data service calls to hold the form data.
• The view is the presentation of any data and display of all user interface elements.
• The controller contains logic that manipulates the model and sends the model to the view.
The promise of the MVC architecture is that by creating components with a well-defined and limited scope, you
increase the reusability of these components and improve the maintainability of the overall system. In addition,
you can modify components without affecting the entire system.
Although you can consider a Flex application as part of the View in a distributed MVC architecture, you can use
Flex to implement the entire MVC architecture on the client. A Flex application has its own view components that
define the user interface, model components that represent data, and controller components that communicate
with back-end systems.
About Struts
Struts is an open-source framework that facilitates the development of web applications based on Java servlets and
other related technologies. Because it provides a solution to many of the common problems that developers face
when building these applications, Struts has been widely adopted in a large variety of development efforts, from
small projects to large-scale enterprise applications.










