Greg's Blog

helping me remember what I figure out

Paths to Java Packages

| Comments

From the cfcdev-zone list, Stephen Bosworth posted the following explanation about paths to packages in Java. This made it clear once and for all what com.package.something actually meant and how it relates to your stored files:

“Say I have a suite of classes that I want to sell, I would create a package name based on my domain (newcastle.edu.au). All my classes would belong to my package, and be assured of no conflict with any one else?s on their systems (unless they create a package named after my domain with the same classes, but why would you want to do that :-) )

Example:
======
Say I have a component name user and I want to give it to you, and you also have a component named user, and you need to use both of them in an application.
All your components should be in your own “package”, namely a reference to au.com.tq (the reference to component would look something like {root}\au\com\tq\user.cfc).
I could give you a “package” of my components, namely au.edu.newcastle (e.g. {root}\au\edu\newcastle\user.cfc ). Now you can reference both without the worry of reference conflicts.”