ColdFusion Job with AboutWeb
We are also looking for senior J2EE and CF developers in both the DC and Baltimore metro areas.
We are also looking for senior J2EE and CF developers in both the DC and Baltimore metro areas.
Reference != Pointer
The code below shows an example of how references work in ColdFusion/Java.
This creates a CF structure and creates a data key with a value of 1. A new object is created on the Java heap which var1 references.

Creates a new variable and sets it to var1. Unlike a pointer in other languages var2 is not pointing to var1, instead var2 is a reference to the same object on the heap as var1.

Since var2 references the same object as var1, you can access the structure created through var1.
If you change the value using var2, the data is also changed for var1. They are both referencing the same object.
This creates a new String Object on the Java heap and changes var1's reference to this new object, var2 is unaffected and continues to reference to the structure object.

I hope this clears up some of the confusion about ColdFusion references.
It's an empty object that has no properties or methods, but I can add properties and methods to it dynamically.
I can even add a dynamic method that uses a property I create dynamically.
You could do some really interesting things with this. You could also do some really bad things with this that would ensure your job security for years to come.
The goals for my object factory are:
Initializing the Factory
The factory takes the base cfc path as a required argument. This path is used to create objects and saves you from worrying about object paths in the rest of your code. The factory initialization also takes an unlimited number of key value pairs that will be used to initialize other objects. For instance many objects need a DSN for initialization either as a simple String or as DSN object. If the object factory is initialized with a DSN then the DSN object will automatically be passed into all object that have DSN as an argument. Currently this matching is based on name and not type, so following a standard naming convention in your init methods is required to use this factory. Here’s a sample of initializing the object factory with a DSN:
Initialization Parameters
The getObject method retrieves an initialized object from the factory. You simply pass in the name off the object you wish to get. The factory introspecs the object using the getMetaData function and will automatically add in initialization arguments. Using the factory created above you could request an object that required the DSN without specifying it.
Additional Arguments
Objects may need additional arguments that aren’t auto populated. The getObject method takes the object name along with an unlimited number of key values pairs. The key value pairs are added to the argument collection for the object init. Arguments are automatically numbered according to the order in which they were passed to the method. Since we pass the object name as the first argument to getObject additional arguments are named numerically starting with 2.
Singletons
The factory supports singletons. Following my no configuration goal I wanted objects to be able to indicate they were singletons to the factory. This is accomplished by adding this.singleton=true to an object. This creates a public singleton property that the object factory can check. The factory checks to see if a singleton has already been created in the singleton cache, if it is in the cache the existing object is returned.
Over all I accomplished my goals. The object factory can be dropped into an application and supports all the functionality I wanted without needing any type of configuration or editing of the object factory code itself. It doesn’t have all the features of some other factories, but covers the functionality you need on a regular basis.
Download Object Factory and Sample Code
Later I found an Adobe Tech Note which suggests updating the drivers after installing the updater.
It turns out the updater installs a new version of a jar file, but doesn't remove the old one. To fix the problem you have to manually go in and remove the old file.
There is an official Adobe TechNote on the issue at: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=96ce62cd&pss=rss_coldfusion_96ce62cd
Multi-server install:
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\jrun-web.xml
Webroot: C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war
Stand alone install:
C:\CFusionMX7\wwwroot\WEB-INF\jrun-web.xml
Webroot: C:\CFusionMX7\wwwroot
To add a new virtual mapping you just add a virtual-mapping tag to the configuration file and specify the resource path and system path like so:
To edit the other settings for the internal web server you have to edit the service in the jrun.xml file, but I’m not going to cover that in this post.
We also have a new version of Shoot the Guru with a twist. This year it’s a video game written in Flash with a motion sensing gun. It’s pretty cool, but I’m bias since I wrote it.
We also did a Podcast today, which will be releasing as soon as we have time to convert it and get it up on the web. Probably not until after the conference.
Unfortunatly Hal Helms can't make it to the conference this year. On the plus side an AboutWeb employee Nic Tunney will be picking up Hal's "Variables and Conditions" presentation.