July 13, 2003

Mach II

The Mach II website is now up! You can read about Mach II and download the (beta) framework and example code. The site is still being worked on so keep watching that space...
Posted by seancorfield at 09:17 PM | Comments (0) | TrackBack | architecture | cf

July 11, 2003

CF OOP / Architecture

I've mentioned cfoop.com before but the architecture section is beginning to contain some more interesting and in-depth commentary. The latest post about structured exception handling is a good example and while I don't agree with every point he makes, it's still worthwhile reading. I've commented on that entry, raising the specter of reuse-through-inheritance which I believe is one of the most common design errors most nOObs make and I've been threatening to write up my thoughts on this subject for many, many months (I started a draft back in October last year!). One day I will write a treatise on it!
Posted by seancorfield at 03:00 PM | Comments (0) | TrackBack | architecture | cf

JSP or CFML?

Came across a somewhat strange article by Chris Preimesberger and Charlie Arehart which purports to advocate ColdFusion over JSP - in an apparent attempt to persuade CFers not to switch to JSP. The article has drawn quite a bit of flak on TheServerSide forums. Some of the criticism is deserved (for the vague swipes at JSP as a technology) and some is just noise (the usual uninformed criticisms of CFML). Read the article, read the comments on TheServerSide and make up your own mind.
My position is that CFML has a much easier learning curve than either JSP or Java while not preventing well-designed software from being written. The abilities of the language need to be discussed separately from the abilities of the developers - bad code and poorly performing applications can be built in any language!
Posted by seancorfield at 12:17 PM | Comments (2) | TrackBack | cf | j2ee

July 09, 2003

Mach II Training

Hal Helms and Ben Edwards are running a three-day training course for Mach II in August, in Las Vegas. This fourteen-unit course will take you through object-oriented programming concepts, CFCs, implicit invocation architecture and moves on to Web Services, Flash Remoting, and Plugins as well as looking at MVC and application architecture. It promises to be a comprehensive and very useful course - if you are at all interested in extending your ColdFusion skills into the OO arena. The early bird rate runs until the end of July.
Posted by seancorfield at 11:06 PM | Comments (0) | TrackBack | architecture | cf

Mach II - corfield.org

I have just added a fledgling Mach II section to my website and updated the Fusebox section.
Posted by seancorfield at 09:20 PM | Comments (0) | TrackBack | architecture | cf

Mach II - Initial Thoughts

I've just started looking at the new Mach II framework (formerly Fusebox MX). The framework is built on an implicit invocation architecture (you can read some background to this on the Fusebox Beta website), using "listeners" and "events" and comes with an MVC example application, ContactManager. The framework uses an XML configuration file to define the behavior of your application. The XML is used to specify "listeners" - CFCs that have methods invoked in response to events - "events", "views" and "plugins". Each event specifies which listeners it notifies and whether it displays a view. Each view specifies the CF page that generates that view. The plugins are CFCs that have various methods invoked at certain points in processing each request (event).
For example, the listContacts event notifies the RecentContacts listener to retrieve 'recent contacts' and the ContactManager listener to retrieve 'all contacts' and then the event selects the contactList view. An event can trigger other events. For example, the newContact event causes a form to be displayed into which you enter new contact details. Submitting the form - the createContact event - causes the ContactManager listener to be notified to create the contact and it announces that a new contact has been created (the contactCreated event). That event is, in turn, specified to generate the listContacts event so that after adding a new contact, you end up on contact listing page.
It takes a bit of getting used to if you're from a procedural background but it's certainly very elegant.
More on this later...
Posted by seancorfield at 12:05 PM | Comments (13) | TrackBack | architecture | cf

July 02, 2003

Fusebox Conference

The 4th Annual Fusebox Conference is in Las Vegas, NV this year (8/30-9/1) with the Sunday sessions devoted to Fusebox 4 and Monday's half-day session devoted to Mach-II (formerly Fusebox MX). It's a very reasonable $99 if you sign up before 7/19 (and only $149 after that).
Posted by seancorfield at 06:16 PM | Comments (0) | TrackBack | architecture | cf

June 26, 2003

Forta Blogging

Ben Forta has finally given in to the inevitable and started blogging. Ben pretty much always has something insightful to say so this ought to be a killer blog.
Posted by seancorfield at 08:18 AM | Comments (3) | TrackBack | blogging | cf

June 25, 2003

Fusebox MX Renamed Mach II

Ben Edwards announced in the Fusebox MX forums that work on FBMX continues under a new name - Mach II. There will be a new website up shortly with more information. I'll post here as I know more!
Posted by seancorfield at 08:31 AM | Comments (10) | TrackBack | architecture | cf

June 22, 2003

Fusebox MX & Nested Layouts

I continue to work on a version of my personal site using Fusebox MX. For most of the display fuses, it's been really easy to copy the dsp_xxx.php file to dsp_xxx.cfm and change references to <?= $self ?> to index.cfm.
One change that has caught me out is that FBMX no longer has the layout wrapping mechanism of FB3. I used to set the page title in the display fuse and the layout would run after the display fuse and wrap its output, including being able to use the title variable I just set in the display fuse. FBMX advocates "plug-ins" for layout so the preView() and postView() are called as the wrappers for your display fuse. Since I want to use the title variable in the pre-view plug-in, I've taken the approach of adding setTitle() to my circuit CFCs and invoking that in the fuseaction section of fusebox.xml. It uses request.title to pass the title around and I'm not sure how I feel about that from an encapsulation point of view.
Then there's nested layouts. In FB3, I used nested layouts to create the left nav in the technical section of the site but FBMX has no such concept and at the moment I'm still pondering the cleanest way to achieve something similar since there's also no longer the concept of 'executing a circuit' to which layouts can be attached. It's proving to be an interesting experiment.
Posted by seancorfield at 11:17 PM | Comments (1) | TrackBack | architecture | cf

June 21, 2003

ColdFusion MX Wins Jolt Productivity Award

This one went past under my radar: Macromedia Products Win Awards. The press release starts out with Flash and FlashCom but also mentions CFMX won a Productivity Award in the 13th Annual Jolt Awards. Software Development Magazine announced the Jolt awards in their June 2003 issue.
Posted by seancorfield at 02:56 PM | Comments (1) | TrackBack | cf

June 20, 2003

Fusebox MX

I'm starting to build a version of my personal website using Fusebox MX as an experiment. Fusebox MX is a radically different beast to 'regular' Fusebox but it's still proving to be much simpler than I expected to take the fuses from my PHP site and drop them into this ColdFusion MX prototype - although I'm still figuring out how to organize the site in the FBMX model (or rather in the FBMX view - since FBMX is MVC and most of my site is V!). I'll write this all up in due course, as I did eventually for the move from unstructured PHP to FB3 PHP.
Posted by seancorfield at 05:18 PM | Comments (8) | TrackBack | architecture | cf

June 17, 2003

ColdFusion & Flash Data Connection Kit

Ben Forta has just published an in-depth article showing how to build a complete Rich Internet Application using ColdFusion and the Flash Data Connection Kit. It's a good read and it shows just how powerful these two products are when used together.
Posted by seancorfield at 05:12 PM | Comments (0) | TrackBack | cf | mx

June 16, 2003

Globalizing ColdFusion

Paul Hastings has created a blog dedicated to globalization issues in ColdFusion. This should be a great resource for anyone considering multi-lingual applications as Paul really knows his stuff! [seen on the Daemonite blog]
Posted by seancorfield at 10:49 AM | Comments (0) | TrackBack | cf

ColdFusion Administration Breez-o

Geoff Bowers has created a great presentation using Macromedia Breeze that covers a lot of useful ColdFusion MX administration hints & tips. Big thanx to Geoff for doing this and sharing with the community!
My only quibble would be that Geoff recommends not using J2EE Session Variables - I would definitely recommend enabling those so you can take advantage of the underlying application servers session management. Not sure why Geoff disagrees - he doesn't give any reason in the preso.
Posted by seancorfield at 10:46 AM | Comments (5) | TrackBack | cf

June 11, 2003

ColdFusion MX - Java Verified

Already mentioned on Christian's blog but it bears repeating: today Macromedia announced that ColdFusion MX has achieved "Java Verified" status.
This also got a mention on The Server Side where they say a bit more about the Application Verification Kit. I'll keep watching that thread to see if any interesting comments appear.
Posted by seancorfield at 04:58 PM | Comments (0) | TrackBack | cf | j2ee

MVCF Updated

Benoit Hedard has updated his MVCF website. He has made these updates:
There is the presentation "MX applications based on MVC" that I did at CF-Europe.
I've also updated all the best practices articles:
  • no Hungarian notation anymore
  • nothing in WEB-INF anymore
  • CFC as controllers (with form remote invocation, it works wonderfully...)
I'm glad to see these changes - especially the removal of Hungarian notation! - and I'll check the site out when I get a chance.
Posted by seancorfield at 12:44 PM | Comments (0) | TrackBack | architecture | cf

June 05, 2003

A Taste of Shared Hosting

I finally have a CFMX hosted account! Right now, it's just a test account with an ISP that is asking folks to test their new 'control panel' and I don't know if it'll stay around once their test is complete, but it will give me a sense of what life is like on a shared server.
So far, the experience has been good: the control panel seems well-designed but, obviously, limited in functionality since you don't get a full CF Admin to play with. Not sure yet what I'll put up there by way of a test, probably a small DB-driven Fusebox MX application if I can think of something worthwhile to build.
Posted by seancorfield at 10:47 AM | Comments (4) | TrackBack | cf

June 04, 2003

CFMX for J2EE on WebSphere

IBM have a great article on their DeveloperWorks site about sharing sessions between ColdFusion MX and WebSphere. Even if you're not specifically using WebSphere, the article should provide you with an interesting insight into how the two technologies - ColdFusion and J2EE - interact.
Posted by seancorfield at 03:05 PM | Comments (0) | TrackBack | cf | j2ee

June 03, 2003

CFUN-03

Don't forget: CFUN-03 is just $249 registration through the 14th of June (and then $299). CFUN-03 is June 21st & 22nd in Maryland.
Posted by seancorfield at 07:53 PM | Comments (0) | TrackBack | cf

Why is CFMX on Mac OS X so great?

Christian Cantrell waxes lyrical about why you should be excited about ColdFusion MX on Mac OS X! Christian talks about why Mac OS X provides the best of both worlds: robust, powerful Unix with an easy to use GUI and all the standard desktop software. The convenience of a PC with the power of a *nix server! Almost every week I see another member of my team has switched from Windows to Mac, with Powerbooks replacing Wintel laptops. Everyone seems very happy with their choice to switch.
Posted by seancorfield at 04:26 PM | Comments (9) | TrackBack | cf | osx

CFMX for J2EE & Hardware Load Balancing

Brandon Purcell and Frank DeRienzo have just published a great article about setting up hardware load balancing for ColdFusion MX and J2EE application servers. This gives the background to how macromedia.com is set up as well as showing what other enterprise-class options you have with hardware load balancing.
Posted by seancorfield at 03:32 PM | Comments (1) | TrackBack | cf | j2ee

June 02, 2003

Red Sky / CFMX

Phil Costa talks about the next release of ColdFusion MX, a.k.a. red Sky. This is a maintenance release and will be a free upgrade for existing ColdFusion MX customers.
Posted by seancorfield at 11:31 AM | Comments (0) | TrackBack | cf

May 30, 2003

Useful CF Links

The ColdFusion Administrator home page has a lot of useful links on it. But you have to log in to see them. Here's a useful page on macromedia.com that provides the same links.
Posted by seancorfield at 11:17 AM | Comments (0) | TrackBack | cf

May 29, 2003

Extending the CF Administrator

A little-known but useful tip: you can add a CUSTOM EXTENSIONS menu item to the left navigation of the CF admin containing your own links. In the /CFIDE/administrator/ directory, create a file called extensionscustom.cfm and put in your links, separated by <br />. Each link should have target="content" so the result of the link will show up in the main frame within the administrator.
It's listed deep within the ColdFusion 5 Release Notes but I don't know if it's mentioned anywhere else.
Posted by seancorfield at 01:22 PM | Comments (0) | TrackBack | cf

May 22, 2003

Why ColdFusion for J2EE Development?

Ben Forta has a great presentation online about why J2EE developers should look at ColdFusion MX as a powerful RAD tool for building J2EE-based web applications.
Posted by seancorfield at 11:18 AM | Comments (1) | TrackBack | cf | j2ee

May 19, 2003

CF Directory Structures

Tim Buntel's DevNet article about the directory structure of the CFMX Pet Market application refers to my blog and a caveat I posted about directory naming for Web Service CFCs. I mention this again here because Tim's article just refers to my blog's top-level URL rather than to the actual post - this will help readers locate the entry!
Posted by seancorfield at 05:24 PM | Comments (0) | TrackBack | cf

Blog Software in CFML (again!)

I got quite a response to my recent post on this subject so I've put together a fledgling Blogging in ColdFusion page that lists the ones I know about. Let me know of others and your experiences with them.
Posted by seancorfield at 02:21 PM | Comments (1) | TrackBack | blogging | cf

May 17, 2003

Blog Software in CFML

In the continuing search for blogging software written in ColdFusion, I was made aware of this CFXML Blog project website. It uses CFCs and stores blog data in XML so the source code is an interesting example of what ColdFusion MX lets you do. The source code is in Italian which might be a bit of a culture shock but it's still pretty easy to follow the code. The resulting blog looks good, is W3C compliant and seems to be pretty fast.
Posted by seancorfield at 05:03 PM | Comments (13) | TrackBack | cf

Comparing Haskell & ColdFusion

I enthused about Haskell without giving any examples of the language and, since many folks have never seen any Haskell code, I thought I'd show how it compares to CFML.
Let's take a simple example - we have a list and we want to apply a transformation of some sort to every element. Perhaps we have a list of strings and we want a list of their lengths, e.g., "This,is,a,list" would produce "4,2,1,4". This is pretty simple to do in CFML. Now let's suppose that we want to write a UDF to do this transformation - for arbitrary lists and arbitrary transformations - mapping a transform (function) across a list. We'll call the function map and it will take two arguments: a function to perform the transformation and the list to transform. If we have a function square() that returns the square of its integer argument, we want to be able to say map(square,"1,2,3,4") and get back "1,4,9,16". Here's the CFML for map:
function map(f,l) {
	if ( l is "" ) {
		return "";
	} else {
		return listPrepend( map( f, listDeleteAt(l,1) ), f( listGetAt(l,1) ) );
	}
}
Note that I'm using recursion. The logic of the UDF says "if l is an empty list then return an empty list, else return f applied to the first element of the list followed by the list obtained by mapping f across the remainder of the list". The order of arguments for listPrepend make the code read rather strangely but, trust me, that's what the UDF does.
Given a few simple UDFs, we can try some things out:
function square(x) { return x * x; }
function length(x) { return len(x); }

sq = map(square,"1,2,3,4,5");
ln = map(length,"This,is,a,list!");
We have to define a wrapper for the len() function because we can't pass built-in functions into map() directly. Try it out and convince yourself that it works... Try mapping a few more functions across various lists...
Once you're comfortable with that, we'll look at the equivalent in Haskell. The first thing to know is that Haskell is a typed language so you declare each function's 'type signature' first. However, let's look at how map() would be defined in Haskell before we look at its type:
map f [] = []
map f (x:xs) = (f x) : (map f xs)
In Haskell, [] is an empty list and (x:xs) is a list that begins with x and has xs as the rest of the list. You can often remove the conditionals (if/else) by declaring multiple patterns for the function arguments. Trust me that this is equivalent to the ColdFusion UDF above!
Now let's look at the types involved. The second argument to map() is a list of something (a) so we designate that with [a]. The first argument is a function that takes an argument of one type (a) and returns a result of a possibly different type (b) so we designate that with a -> b. The result of map() is a list (of type b). map() is therefore declared:
map :: (a -> b) -> [a] -> [b]
I'll probably post some more articles exploring Haskell and comparing it with CFML in due course.
Posted by seancorfield at 03:33 PM | Comments (1) | TrackBack | cf

When cfobject and createObject() are disabled

If you're on a shared host, you might find that your hosting company has disabled cfobject and createObject() so that you can't instantiate Java objects. In ColdFusion MX, you can call getClass() on any simple expression to object an object of type Class. From that you can load the class for any other type, using forName("my.package.MyClass"). Once you have that, you can instantiate the class using newInstance() as long as it has a default constructor:
x = 0;
classObject = x.getClass();
myClassHandle = classObject.forName("my.package.MyClass");
myClassObject = myClassHandle.newInstance();
If your class does not have a default constructor, you have to jump through a few more hoops. First, you have to get the appropriate constructor (getConstructor(Class[] parameterTypes)) which means you have to construct an array of the appropriate Java class objects. I'm not going to go into that today but if folks want me to some code, I'll write it up and post it (otherwise, it's an exercise for the reader!).
Posted by seancorfield at 01:22 PM | Comments (3) | TrackBack | cf

May 16, 2003

CFMX & Mac OS X

Macromedia's DevNet is fairly Mac-heavy right now, including an article on installing CFMX on Mac OS X. The new Flash Detection Kit is also heavily featured.
Posted by seancorfield at 11:12 PM | Comments (0) | TrackBack | cf | macromedia | mx | osx

CFLib.org RSS Feed

Seen on Ray Camden's blog, CFLib now has an RSS feed describing new utilities on the site.
Posted by seancorfield at 11:05 PM | Comments (0) | TrackBack | blogging | cf

May 15, 2003

CFMX : Coming Up

The Twin Cities ColdFusion User Group was host to Ben Forta recently and he talked about the next CFMX release. A lot of enhancements coming down the pipe. Stay tuned for more information soon!
Posted by seancorfield at 07:47 AM | Comments (0) | TrackBack | cf

May 11, 2003

Fusebox 4 & Fusebox MX Forums

The Fusebox(.org) site has new forums specifically for discussing Fusebox 4 and Fusebox MX. If you're following Fusebox development, you should check out the new forums.
Posted by seancorfield at 10:22 PM | Comments (0) | TrackBack | cf

May 07, 2003

Meet The Makers & Jeremy Allaire

As part of the ongoing Conversations series, Jeremy Allaire is interviewed about ColdFusion, the web and the future of wireless.
Posted by seancorfield at 09:59 PM | Comments (0) | TrackBack | cf | wifi

CFMX for J2EE & Windows

Yesterday I did my first full install of JRun 4 and CFMX for J2EE on Windows. Last time I worked on Windows, CFMX Server had just been released and CFMX for J2EE was under development. I'd gotten used to installing CFMX Server on Windows (I did it countless times during the Neo development cycle!) so it was a pleasant surprise to find how smooth the process was.
JRun 4 installed cleanly and uneventfully (on C:\), although the server didn't have Java installed so halfway through the JRun install I had to pause while I downloaded and installed Sun's 1.4.1_02 JVM (J2SE). I configured JRun with IIS to serve .jsp and .jws files and tested it with a simple JSP in the default IIS wwwroot (on E:\). No problem.
Then I started the CFMX for J2EE install and decided to go for the EAR install (habit, even tho' I always end up unpacking it to get at the WAR files!). Now I had cfusion.ear and no jar command. Hmm. So I downloaded WinZIP and used that to unpack the EAR file (to get at the two WAR files) and then unpack the WAR files into the JRun default server (under CFIDE and cfusion). Then I used JMC (JRun Management Console) to edit the context root to / and told it the document root was E:\inetpub\wwwroot\. Finally, I ran wsconfig to connect it to IIS. Done! Both JSP and CFM files serve up from the same directories as HTML.
Then it was time to test the CF5 applications on this box. I created a few data sources (Oracle 8) and tried the apps. The first one failed because it used client variables and I always disable those in the admin (along with selecting J2EE session variables). Changed client variables to use cookies and the first app worked just fine. The next app failed because it had ';' at the end of some of its SQL statements - allowed by the CF5 Oracle drivers, not allowed by the CFMX Oracle drivers. That's a fairly simple edit (regex replace ';$' with '').
The only real glitch in all of this is that, for some reason I haven't figured, cfregistry does not seem to be able to read or write the registry. That means that ODBC DSNs do not show up in the CF administrator and it's hard to create certain data sources (e.g., Microsoft Access). The workaround for the moment is to create the System DSN in Windows and then attempt to create an Access data source in the CF administrator with the same name but no file path value. "Submit" produces a failures (unable to update the registry and DRIVERPATH variable undefined) but the data source is created and, because it mirrors the System DSN, it verifies just fine.
Thanks to Brandon Purcell, this glitch is fixed. He said:
To fix this add the necessary dlls' to the java.library.path in jvm.config
java.library.path=C:/JRun4/servers/default/cfusion/WEB-INF/cfusion/lib
All my cfregistry tags and ODBC machinery work just fine now.
And a further note: it was pointed out that this configuration change is mentioned in the install docs... I just missed it (and I was actually making an effort to follow the docs for once). At least it's a simple fix and easy to debug and identify the problem. Mike Nimer had me create this simple script to verify the function of cfregistry:
<cfset Branch_ODBCDS�� = "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources">
<cfregistry action="GETALL" name="qODBC" type="string" sort="entry" branch="#Branch_ODBCDS#">
<cfdump label="ODBC Data Sources" var="#qODBC#">
Posted by seancorfield at 03:41 PM | Comments (2) | TrackBack | cf | j2ee | j2ee

Fusebox 4 Beta!

The Fusebox 4 beta is now active through July 4th. There are to be two flavors of Fusebox 4: Fusebox 4 for XML (aka FB4) and Fusebox 4 for CFCs (aka FBMX). They share many commonalities (XML configuration, plugins etc) but are radically different in structure and approach. I've downloaded all the code so I'll be experimenting over the next few weeks and writing up my experiences.
Posted by seancorfield at 12:22 PM | Comments (0) | TrackBack | architecture | cf

May 05, 2003

DevNet Updated - Lots of ColdFusion Content!

The latest DevNet update provides plenty of meat for ColdFusion developers. You can start off with Ben Forta's Logged In column extolling the virtues of CFMX. That article links to several others, including new articles on integrating CFMX and J2EE by Drew Falkman, using cftransaction by Simon Horwith, building Object-Oriented user interfaces by David Friedel and caching by Matt Boles. Plenty of thought-provoking and informative ColdFusion goodness!
Posted by seancorfield at 07:37 PM | Comments (0) | TrackBack | cf | macromedia

May 01, 2003

cfform & /CFIDE

A couple of weeks ago, I mentioned how to get cfform working on a hosted environment. Macromedia has a new Tech Note that says much the same thing so now it's even easier to find the solution to this problem!
Posted by seancorfield at 11:03 AM | Comments (0) | TrackBack | cf | macromedia

April 30, 2003

Managing Whitespace

A useful tip from Christian Cantrell about leveraging CFMX's Java integration to remove unwanted output when generating XML output.
Posted by seancorfield at 01:30 PM | Comments (1) | TrackBack | cf | j2ee

April 29, 2003

CFUN-03

CFUN-03 is happening in June in Maryland. If you're quick, you can still get the early bird registration ($199 thru 4/30, $249 after that). There's some great speakers, including our very own Christian Cantrell, and Hal Helms and John QT will be talking about Fusebox 4 and sharing code!
Posted by seancorfield at 07:02 PM | Comments (0) | TrackBack | cf

April 28, 2003

ColdFusion Floats

What a brilliant idea! A ColdFusion-at-sea conference! Speakers / trainers include Ben Forta, David Vaccaro and Pete Freitag. Avast ye land lubbers!
Posted by seancorfield at 02:54 PM | Comments (1) | TrackBack | cf

April 24, 2003

BACFUG: Web Services

I'm presenting at tonight's BACFUG meeting. I'll be going over my Under the Hood report to look at the architecture behind macromedia.com then I'll be showing a little of what would be possible if the website had a public Web Services API.
Why don't you comment on this entry, telling me what you would like to see made available as a Web Service on macromedia.com? The most popular suggestion I've received so far has been to provide Web Service access to the search function.
Posted by seancorfield at 09:58 AM | Comments (2) | TrackBack | cf | macromedia

April 22, 2003

DRK3 & Firefly

Some very exciting announcements on Macromedia DevNet today about the latest DevNet Resource Kit (Volume 3) and the Macromedia Firefly Components behind the forthcoming Flash MX Data Connection Kit.
DRK3 speaks for itself with a lot of ColdFusion content this time around as well as some great sample applications.
You can get a sense of just how exciting the Data Connection Kit will be by reading Aral Balkan's article Building an RSS Aggregator with Macromedia Firefly Components.
Posted by seancorfield at 09:55 AM | Comments (3) | TrackBack | cf | macromedia | mx

April 18, 2003

CFMX & XML-RPC

Big Damn Heroes' blog has a post about XML-RPC that provides a CFC to convert between ColdFusion data structures and XML-RPC format. This allows you to easily create XML-RPC services in CFMX as well as consume them.
Posted by seancorfield at 12:31 PM | Comments (0) | TrackBack | cf

Fusebox 4

Hal Helms and John Quarto-vonTivadar will be unveiling Fusebox 4 at the Atlanta ColdFusion User Group meeting on May 7th. I believe it may be broadcast using Flash Communication Server but have no further details at present.
Posted by seancorfield at 09:58 AM | Comments (1) | TrackBack | architecture | cf

April 17, 2003

CFMX / IIS Startup Dependencies

An excellent post in Dan Switzer's blog explains the startup dependencies between IIS and ColdFusion MX, and how to update the registry to ensure those services startup in the correct order.
Posted by seancorfield at 08:37 PM | Comments (0) | TrackBack | cf

April 16, 2003

DevNet: ColdFusion & Databases

Debbie Dickerson's Logged In column focuses on resources to get you up to speed with using databases in ColdFusion.
Debbie provides a lot of links including a new article by Sue Hove about Advanced Queries in ColdFusion that is worth reading.
Posted by seancorfield at 11:54 AM | Comments (0) | TrackBack | cf

April 15, 2003

cfform & /CFIDE

A commonly asked question by folks trying to use cfform and its ilk in a hosted ColdFusion MX environment is "Why won't my CF5 code work on CFMX?"
First of all, why should it break? In CF5, cfform etc generated inline JavaScript code to perform validation. In CFMX, that JavaScript is kept in a file instead and included where needed. Unfortunately, that file is under /CFIDE/scripts/ and if you're in a hosted environment, you may well not have the administrator available to you so CFMX cannot find the JavaScript source file.
According to the documentation, cfform takes a scriptSrc attribute:
scriptSrc - optional, Default: /cfide/scripts/cfform.js - Lets the user control the URL of the script file; useful if you do not keep the file in the /cfide directory.
Useful if you don't have a /CFIDE directory too! Just push your local copy of cfform.js up onto your hosted server and use scriptSrc to point to it:
<cfform scriptSrc="/myscripts/cfform.js" ...>
Posted by seancorfield at 09:32 PM | Comments (0) | TrackBack | cf

ColdFusion is not Java, part 97: this scope

ColdFusion's "this" scope seems to cause endless confusion because people keep thinking it is something like "this" in Java. I posted the following to cf-talk today in yet another attempt to highlight that CF is scope-based whereas "this" in Java is an alias for the current object, i.e., it's more like a variable.
Here's some code to show just how radically unlike Java's "this" it is:
<cfcomponent>
	<cffunction name="hidden" access="private">
		<cfreturn "I'm a private method">
	</cffunction>
	<cffunction name="changeable" access="public">
		<cfset this.changeable = hidden>
		<cfreturn "I'm public - call me again!">
	</cffunction>
</cfcomponent>
Now, call "changeable()" twice on the same instance:
<cfset obj = createObject("component","sly")>
#obj.changeable()#
#obj.changeable()#
You'll get:
I'm public - call me again! I'm a private method

This is meant to show that ColdFusion's "this" is a scope in which you can manipulate variables with abandon, adding and changing anything you want.
Posted by seancorfield at 09:11 PM | Comments (1) | TrackBack | cf

April 10, 2003

Design Patterns & ColdFusion

As most folks know by now, I'm a big fan of design patterns and they feature heavily in the ColdFusion code that underpins macromedia.com.
Brendan O'Hara has started what promises to be an awesome series in the ColdFusion Developers' Journal which looks at classic design patterns implemented in ColdFusion MX. So far, he has covered the Template Method Pattern and the Iterator Pattern.
Posted by seancorfield at 06:04 PM | Comments (2) | TrackBack | architecture | cf

April 01, 2003

cfargument & arguments

A curiosity about the interaction between the cfargument and the actual arguments structure / array was posted to the CFCDev mailing list today. It seems that if you use cfargument with required="false" then such arguments appear in the arguments scope even if no value is passed... sort of...
<cfcomponent>
  <cffunction name="foo" returntype="numeric">
    <cfargument name="a" required="false">
    <cfreturn arrayLen(arguments)>
  </cffunction>
</cfcomponent>
If you call foo it will return 1 even if you don't pass an argument. If you pass an argument called b, it will return 2 - 1 for a declared and 1 for b passed in.
You need to use structKeyExists(arguments,"name") to detect whether an actual argument is passed - don't rely on the 'length' of the arguments scope.
Posted by seancorfield at 07:27 PM | Comments (2) | TrackBack | cf

March 30, 2003

Depressed Press: Variables

Jim Davis just published a very useful and very thorough guide to variables in CFML. It explains all the different data types and different scopes so, no matter how much experience you have with ColdFusion, you'll learn something new. Depressed Press also has an equally excellent guide to locking which talks about race conditions and when and why you need to use cflock. Highly recommended!
Posted by seancorfield at 12:39 PM | Comments (0) | TrackBack | cf

March 29, 2003

Under the Hood

The first of a series of Under the Hood articles is now up on macromedia.com - these will show you what's going on behind the scenes on the new site. In this report, I talk about the architectural evolution of the ColdFusion applications on the site, moving from 'traditional' CF5 applications through to Rich Internet Applications. Hope you enjoy it!
Posted by seancorfield at 01:17 AM | Comments (1) | TrackBack | architecture | cf | macromedia

March 22, 2003

Context Root Neutral

When you're writing CF code that may have to run on both ColdFusion MX Server as well as CFMX for J2EE, you need to think about context roots. With CFMX Server, your URL paths are always something like /path/to/file.cfm. However, CFMX for J2EE inherits the underlying J2EE application server concept of context roots for applications - a unique prefix for each web application deployed on the server. You can choose to deploy CFMX for J2EE in the default - or empty - context root in which case your URL paths will be the same as for CFMX Server. If you are creating code that your customers are going to deploy on their own servers, they might well choose to use a different context root. In the examples in this blog, I usually refer to a context root of /cfusion so your URL paths are something /cfusion/path/to/file.cfm.
CFMX applications can be written to work regardless of the actual context root because the context root can be determined dynamically.
For example, you could add this line to your Application.cfm:
<cfparam name="request.contextRoot"
	default="#getPageContext().getRequest().getContextPath()#">
Then you can use #request.contextRoot# wherever you need to construct a root-relative URL:
<a href="#request.contextRoot#/path/to/myfile.cfm">link</a>
Posted by seancorfield at 02:02 PM | Comments (0) | TrackBack | cf | j2ee

March 21, 2003

ColdFusion MX Updater 3

Reported everywhere already, but I was waiting until I'd installed it myself before blogging anything about it. I downloaded the CFMX for J2EE version yesterday morning (using the AIX download to get the JAR file) and installed it on JRun on my PowerBook G4. It went very smoothly and the whole process took only about ten minutes before I was up and running again. I'm going to install it on Tomcat later today (alongside my existing three instances!). The nice thing about the J2EE version is that you can easily upgrade one instance of CFMX without upgrading others so that you can run your applications side-by-side on both the original and the updated CFMX for J2EE for regression testing.
First off, make sure you read the release notes for details of all the fixes in this update - it's a long list!
Second, read the Updater FAQ, in particular What's required to use the Updater?. You need a Macromedia Membership ID. That means you need to login to get the Updater, which means you need the latest Macromedia Flash Player.
My favorite fixes in Updater 3 are probably:
  • The Web Service proxy in Flash Remoting can now be disabled (and is disabled by default). I talked about this issue in January. It's good for security.
  • Web Services have been enhanced by upgrading the Axis engine to the 1.0 release. Furthermore, CFMX Web Services can now be consumed by .NET clients.
  • All the web connector fixes! Lots of them, including the failure under load with Apache 1.3.x with I reported back in September.
  • Search Engine Safe URLs are now correctly supported.

Let me kn