The following table lists the locations in which you can save component files and how they can be accessed from each location:
URL |
Form |
Flash Remoting |
Web services |
ColdFusion page |
|
---|---|---|---|---|---|
Current directory |
N/A |
Yes |
N/A |
N/A |
Yes |
Web root |
Yes |
Yes |
Yes |
Yes |
Yes |
ColdFusion mappings |
No |
No |
No |
No |
Yes |
Custom tag roots |
No |
No |
No |
No |
Yes |
When you store components in the same directory, they are members of a component package. You can group related CFCs into packages. Your application can refer to any component in a directory specifically by using a qualified component name that starts with a subdirectory of one of the accessible directories and uses a period to delimit each directory in the path to the directory that contains the component. For example, the following example is a qualified name of a component named price:
catalog.product.price
In this example, the price.cfc file must be in the catalog\product subdirectory of a directory that ColdFusion searches for components, as listed in the preceding table. When you refer to a component using the qualified name, ColdFusion looks for the component in the order described in Specifying the CFC location.
Establishing a descriptive naming convention is a good practice, especially if you plan to install the components as part of a packaged application.