More info below the graphic...
Common ColdFusion structures and scopes used in teh Adilas.biz business application.


ColdFusion Structures & Scopes
ColdFusion Structure & Scopes
This diagram shows a large dresser with multiple predefined drawers. Think about both predefined and user-defined containers for storing values and data. We use this analogy to help new developers understand where things are stored and how to get pieces in and out of the application. The drawing has a number of predefined dresser drawers called structures (super variables with names and objects). Here is a list of the predefined structures and what are called scopes.

1. variables scope - Set on the page level. They only live on the page where they are created. This is the default scope.

2. URL scope - These values get passed in to a page via the web address field or URL. These values may be passed from page to page and allow dynamic access points from the web address or link bar. These values are often used to help speed up dynamics, templates, and quick dynamic page results.

3. FORM scope - These are values that get passed to a page from user interactions. FORM scope values often come from searches, reports, data fields, selections, filters, and other web form based options. The FORM scope is much bigger than the URL scope and should be used if size, quantity, and/or security options are needed. Technically, these values are virtually passed behind the scenes in page headers and page bodies. The normal public can't see these variable/value pairs without looking deeper into the underlying pieces. Think of the FORM scope like a giant hidden folder full of data that gets passed from page to page. The hidden folder is marked as private or don't show the values unless asked.

4. session scope - The session scope is set at the cloud or virtual memory level. This is great for storing things that need to last (timeframe) between page requests. These are things like logins, user settings, date ranges, shopping cart data, and other pieces that may be needed by one or more pages. As long as the user is interacting with the server, the session variables will continue until cleared or a preset time period (2 hours) of inactivity occur. Whichever is first.

5. application scope - These values are set when the server starts up and gets used for the first time. The application variables are at the site or server level. These variables and values can live on and on for days, weeks, months, etc. They are values and settings that are needed in multiple places in your site and/or application.

6. arguments scope - These values are used inside of methods, functions, or internal API socket connections. They must be passed in when calling and/or requesting methods or functions. Often arguments have requirements, defaults, and even data types (strings, numeric, dates, etc.).

7. attributes scope - These values are used inside of ColdFusion when making, using, and creating things called custom tags. The custom tags are usually some sort of action or routine that gets performed over and over again. The custom tags help the developers to code once and then use over and over again.

8. CGI Scope - These values are fairly techy and are created behind the scenes. This scope allows the developers to get at things like server paths, page names, IP addresses, and other http or web settings (hyper text transfer protocol).

9. Other Predefined Scopes - This entry is here to help the developers know that there are a number of other scopes that are specific to the task at hand. These include things like error scopes, cffile scopes, cfhttp scopes, and try/catch options. There are a number of other scopes that may be available. See the actual code and/or documentation for more information.