An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Entries for month: January 2009

cf.Objective() 2009 - Schedule Posted

January 31, 2009 ·

I know a lot of people have been asking about this so I wanted to let everyone know that the cf.Objective() 2009 schedule has just been posted!

Tags: coldfusion · cfobjective

Railo + OpenBD + ColdFusion on JRun

January 30, 2009 ·

If you have ColdFusion installed in the multiserver configuration (which is the only way I ever install it!), it's easy to also install Railo on top of JRun in the same setup. With ColdFusion in multiserver configuration, you have:
{jrun.home}/servers/cfusion/cfusion-ear/
In that directory is META-INF/, containing application.xml, and cfusion-war/, containing the ColdFusion instance itself. Download the Railo 3.0.2 WAR file (at the bottom of the downloads page) and unpack the WAR file to a directory called railo-war. You can use jar xvf or rename the .war to .zip and just unzip it. Your railo-war/ directory should now contain WEB-INF/, index.cfm and License.txt. Now move that railo-war/ directory into the cfusion-ear/ directory mentioned above (so it's next to the cfusion-war/ directory. Finally, edit that application.xml file and copy the <module> definition for cfusion-war and change it to say railo-war for the web-uri and /railo for the context-root. Start ColdFusion and you'll see it starts both application servers. http://localhost/index.cfm is Adobe ColdFusion and http://localhost/railo/index.cfm is Railo CFML. If you write frameworks (like I do), this makes it easier to test across multiple engines. I'll probably stick Open BlueDragon 1.0.1 in there next. The same process works for the OpenBD WAR file. Caveats: 1. For OpenBD, I had to add an Apache alias for /openbd to match the location of the exploded WAR so that images loaded correctly (in the shiny new OpenBD Administrator - nice job guys!). 2. For both Railo and OpenBD, I experienced some problems with xmlParse() - OpenBD in particular said "The configured XML parser does not support JAXP 1.3." The solution to the second problem was to add the following to java.args in jvm.config:
-Djavax.xml.parsers.DocumentBuilderFactory=
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
(all on one line, no space after the =)

Tags: coldfusion · railo · openbd

BACFUG - February 18th - Peter Farrell on ant

January 26, 2009 ·

Peter Farrell will be presenting remotely to BACFUG on the topic of ant. See BACFUG on Adobe Groups for more details. We'll be covering Fusebox, Model-Glue and Mach-II in coming months, based on requests from our members. If you have any suggestions for topics or speakers, please comment on the BACFUG plans for 2009 blog post.

Tags: bacfug · coldfusion

Blast from the past...

January 16, 2009 ·

I just opened up one of my Eclipse .project files and found it had this nature:
<nature>com.richpalette.he3.he3free.natures.cfml</nature>

Tags: coldfusion

How do you find your classes?

January 15, 2009 ·

Thinking in objects can be really hard and one of the biggest stumbling blocks for many who are new to OO design is identifying what are the right things in the problem domain to model as classes. This topic came up in a recent thread on the excellent cfcdev mailing list and Alan Livie shared his recommendation for Robert C. Martin's book "Agile Principles, Patterns, and Practices in C#". In particular, he pointed list members to chapter 20 which discusses the design of objects to represent a coffee maker. That particular chapter is available as a PDF and it's a really good read. It starts off explaining the problem to be solved and then presents the "obvious" object model that most new OO students come up with. Then he takes it apart, explaining why it's a poor design, and goes on to construct a much better model (with fewer objects) that is very elegant and easy to understand. If you're struggling with the OO design process, you need to read this PDF and absorb the lessons laid out within it. Even if you think you're an OO 'guru' you'll probably learn something from it!

Tags: coldfusion · architecture

Java 6 and ColdFusion 8

January 14, 2009 ·

Update: The Java 6 class loader bug mentioned in this post was fixed in Update 10. I just upgraded a 64-bit Red Hat Linux server to Java 6 Update 11 and changed the jvm.config file to specify the new JDK's jre directory for java.home. After restarting the server, it was able to serve up the first page of a complex Model-Glue / ColdSpring / Transfer application in just a few seconds. With the default JDK installed by ColdFusion 8 (1.6.0_04), it took between 30 and 60 seconds to serve that first page. I have updated this blog post accordingly. Thanx to Charlie Arehart for prodding me earlier today on this issue.
Some people have been noticing dramatically slower application startup times on ColdFusion 8 compared to ColdFusion MX 7. I've seen a lot of complaints about shared hosting systems where applications timeout. Since CF8 is so much faster than CFMX7, you might wonder why application startup times can be so much worse.

[Read more →]

Tags: coldfusion · j2ee

Pet Peeve about Skype users

January 14, 2009 ·

Recently I've received a number of "add contact" requests from people on Skype who have nicknames I don't recognize, who have not completed their profiles and who don't put any information in their "add" request. Why do such people think I'm going to accept their add contact request? I generally just block them since they seem to have such poor manners (and one such user actually called me twice via Skype without introducing themselves and then pulled me into a conference call with the Skype echo tester!). So, if you're going to add me to your Skype contacts, please at least say who you are and how you know me when you send the "add contact" request! Better still, fill out your Skype profile with your full name and blog / website address so folks have some context.

Tags: personal

cfSpec 0.1.1 adds suites and many new matchers

January 11, 2009 ·

Ron just posted a new version of cfSpec to RIAForge that improves performance, adds a convenient way to run a directory full of specs and overhauls the "should" matchers to provide a much richer set of expectations. Check out Ron's blog post for more details of this new release.

Tags: coldfusion · tdd

Windows 7

January 10, 2009 ·

Lemming-like, I downloaded the Windows 7 Beta this afternoon and installed it under VMWare Fusion to see how it compares to XP and Vista. I chose the 64-bit version since folks had said part of my problem with Vista was that I'd (foolishly) used the 32-bit version. My first impression is "Meh! It's Vista with a paint job and a tune-up!". I'd forgotten that Adobe Flash Player doesn't support 64-bit but, interestingly, whilst Windows 7 has 64-bit IE8, it won't let you set it as the default browser so you have to specifically choose the 64-bit version (which definitely seems to run faster than the 32-bit version of IE8). The first thing I tried to install was Google Chrome. "Aw snap!" says Chrome - it doesn't work on 64-bit Windows 7. [Update: see my comment below about --in-process-plugins] So I installed Adobe Flash Player in IE8 32-bit and then hit the Broadchoice web site and installed Workspace for Salesforce. With the Flash Player installed, the AIR + Workspace installation was smooth as expected and it runs well. I'll probably try installing Safari and Firefox next and see how those behave.
Safari behaves well. QuickTime is a bit choppy on the audio but that's probably to be expected in a VM. I should have mentioned that whilst I tried to run Vista with 768MB, I only gave Windows 7 512MB like my XP VM and it's still running "acceptably" which might be due to using the 64-bit version or the performance improvements Microsoft claim to have made.

Tags: microsoft

File Upload and CFCs

January 09, 2009 ·

This question crops up fairly often on mailing lists and I usually have to Google the answer so I figured I might as well blog the solution so I can find it more easily (and perhaps so can others).
I'm handling a form post in a CFC but I can't get file upload to work. How do you use <cffile> in a CFC?
The key here is that <cffile> expects a form field name for the filefield= attribute. You'd normally say:
<form enctype="multipart/form-data" ...>
<input type="file" name="userfile" ... />
...
<cffile action="upload" filefield="userfile" ... />
What people often try to do is pass the form fields into the CFC as arguments to a method and then they cannot figure out what to put in the filefield= attribute. Inside the CFC, you still need the name of the field in the <cffile> tag when you specify filefield=. The easiest way to do this is to pass the name of the form field to the method:
service.uploadDocument("userfile");
and then inside the method:
<cfargument name="formfield" ... />
...
<cffile action="upload" filefield="#arguments.formfield#" ... />
Note the #..# there to evaluate the argument to get the string passed in - the form field name. This is based on Todd Rafferty's post to cf-talk which was the clearest explanation I found via Google!

Tags: coldfusion