Macromedia flex 2 Manual

Page of 254
91
8
CHAPTER 8
Creating Advanced MXML 
Components
One of the common goals when you create MXML components is to create configurable and 
reusable components. For example, you might want to create MXML components that take 
properties, dispatch events, define new style properties, have custom skins, or use other 
customizations. 
This topic describes advanced techniques for creating advanced MXML components. For 
information about how to create and deploy simple MXML components, including how to 
apply styles and skins to your MXML components, see the topic 
Contents
About reusable MXML components
One design consideration when you create custom MXML components is reusability. That is, 
do you want to create a component that is tightly coupled to your application, or create one 
that is reusable in multiple applications?
A tightly coupled component is written for a specific application, often by making it 
dependent on the application’s structure, variable names, or other details. If you change the 
application, you might have to modify a tightly coupled component to reflect that change. A 
tightly coupled component is often difficult to use in another application without rewriting it.
You design a loosely coupled component for reuse. A loosely coupled component has a well-
defined interface that specifies how to pass information to the component, and how the 
component passes back results to the application.