User Guide

313
CHAPTER 18
Components
Programmers use various strategies to encapsulate their work because experience shows that well-
organized programs are easier to maintain, enhance, and reuse. Different technologies offer
programmers different ways to accomplish this encapsulation, and different names describe these
strategies: functions, modules, and others. Macromedia Dreamweaver MX 2004 uses the term
component to refer to some of the more popular and modern encapsulation strategies, including
web services, JavaBeans, and ColdFusion components (CFCs). So, when users build web
applications in Dreamweaver, the Components panel assists them in using available web services,
JavaBeans, and CFCs.
If you have invented (or simply use) a component strategy that is not represented in
Dreamweaver’s current Component panel, you can extend the Component panel’s logic so the
panel can handle new kinds of components. The files you need to alter are discussed in this
chapter. In some cases, you need to write some JavaScript code that calls certain component-
related functions.
Components from recent technologies (such as web services, JavaBeans, or CFCs) can describe
themselves. In other words, a program such as Dreamweaver can ask a component for a list of the
functions it exposes (meaning functions that can be invoked from another program). Depending
on the technology in use, a component can reveal other information about itself. For example, a
web service might describe new data types.
To add a new kind of component to the Dreamweaver Component panel, you need to locate the
available components (in the users environment) and request descriptions from each component
(or parse them if they are written using ASCII files).
The precise way that the location of components and how component details are retrieved varies
among technologies. Additionally, it can vary based on the server model (ASP.NET, JSP/J2EE,
ColdFusion, or others). So, the JavaScript you write to extend the Component panel depends on
the component technology you need to add. The functions described here are meant to assist you
in getting information to appear in the Component panel, but you must write much of the logic
for locating components and introspecting them (querying the internal structure of the
component and making its fields, methods, and properties available through Dreamweaver).
Finally, server models such as ASP.NET, JSP/J2EE, or ColdFusion tend to support some, but not
all, component types. For example, ASP.NET supports web services but not JavaBeans.
ColdFusion also supports web services and CFCs. When you add a new component type to the
Component panel, it must be server-model specific.