Naming Your Services

I used to work with a guy named Jeff. One day, a new employee—also named Jeff— joined the company. Rather than try to deal with the potential name conflicts, we simply called the new guy “Jim.” This worked so well that the boss began using the name Jim on his pay envelope. If someone named Jim were to join the company, however, the naming convention would have to have been reevaluated.

Just like real-life names, service names can have conflicts. It is important that you organize server-side services in such a way that your namespaces don’t collide (i.e., conflict) with other namespaces. For example, if you name your service HelloWorld, users attempting to access it might unintentionally access another HelloWorld service of the same name. This is called a namespace collision.

To avoid collisions, service names should always include the directory structure, as used in the package-naming structure of Java, where the package name relates to the domain name and project information of the package. For example, a service from Macromedia for a “Remoting” project might be named com.macromedia.Remoting. The next section describes in more detail how to create a namespace (and the directory structure it implies) that will work for examples in this book. Use this directory for all of your server-side services.

Creating the Sample Directories and Package Structure

After you’ve installed ColdFusion, JRun, or another application server and the Flash Remoting gateway adapter, ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.