Archive for August, 2003

Sorry for the Silence

I haven’t gotten a chance to post anything recently because I’ve been in the process of moving. There is certainly nothing more disruptive in life than packing everything tangible you own in the entire world, moving it on one of the hottest days of the summer, and then reconstructing your entire home from scratch. The only exception is probably having a baby. At least moving only affects you for a week or so, as opposed to anywhere between 18 and 21 years.

Anyway, I’m somewhat settled at this point. Just waiting for my DSL to be activated. I forgot you could actually use phone lines to dial into a network, however now I remember why I stopped doing it.

Which Editors Do You Use, and Why?

With the announcement of Dreamweaver MX 2004, there has been a lot of talk about editors out there. Which editor(s) do you use, and why?

Me? Well, I use a few different editors. I use Dreamweaver sometimes as it’s the most feature rich editor I have at my disposal. I like the simplicity and speed of TextPad for some things when I’m using my Windows machine, which isn’t very often. And although I know it sounds strange, I probably use vim (VI Improved) more than anything. I’m the kind of person who likes to use one editor for everything, which makes vim perfect. Not only can I use it for all types of code, but I can use it everywhere, on any platform, even over an SSH connection, which is very important for me.

I’m guessing that vim is actually one of the least popular editors out there for ColdFusion and Java development, so what else are people using? Dreamweaver? TextPad? EditPlus? ColdFusion Studio? Homesite? jEdit? Eclipse? Emacs? Something I’ve never heard of? Make sure you mention what it is about your editor that you like.

Dreamweaver MX 2004 for ColdFusion Developers

I’ve seen some comments out there about Dreamweaver MX 2004 not offering ColdFusion developers any new features. It’s true that a great deal of emphasis for this release was placed on CSS support and designer tools, but aren’t these features just as important to ColdFusion developers as they are to anyone else? Anyone who uses ColdFusion should be looking very seriously at CSS, if not already using it full time. As far as I’m concerned, features that are good for web development in general are good for ColdFusion developers.

There are several other features that I think are huge wins for ColdFusion developers. Although I haven’t had time to really familiarize myself with Dreamweaver MX 2004 yet, as I read through the list of new features, the following really caught my attention:

  • Siteless file editing (thank you!)
  • Keyboard shortcuts for snippets
  • CSS support (including CSS code hints and cross-browser validation)
  • Secure FTP
  • Built-in graphics editor (very cool!)
  • Right-click coder tools

And finally, if you try Dreamweaver MX 2004 and still think it just isn’t for you, it comes with a new version of Homesite+!

Application Configuration: How Do You Do It?

There are lots of ways you can configuration an application. You can define server, application, or request variables in your Application.cfm file; you can load an external XML file; you can use an INI, or initialization, style file; you can store you application’s configuration parameters in a database (although often, configuration data contains data source information, so that’s a bit like locking your keys in your car). You can even try to dynamically determine your configuration based on your environment.

I find myself using a little of everything. Primarily, I use the init custom tag from DRK 3 and put configuration in my Application.cfm file. I actually like using code to express my application’s configuration as opposed to text formats like INI or XML because code is more flexible and often less verbose. If it gets out of control and I want to externalize huge lists of things like products or countries or something, I will use an XML file or store them in a database table, depending on how dynamic I need them to be, and whether I have time to build an interface for editing the information in the database, which I usually don’t.

What techniques to you use in different circumstances, and why?

Macromedia Launches MX 2004

Macromedia announced the new MX 2004 product line this morning with five new products:

Click on any of the links above to learn more about each product. You can also hook up with your local user group and participate in the first world-wide, public demonstration of the MX 2004 product line on September 3rd. There will be a copy of Studio MX raffled off at each participating user group.

Customer Research: How Do You Use CFHTTP?

I’d like to find out the primary ways in which ColdFusion customers use the CFHTTP tag. Specifically, I’m interested in the following:

  1. How often do you use it?
  2. What types of things do you use it for?
  3. Do you primarily use it for GET or POST operations?
  4. Do you use its more advanced capabilities like proxy and query support?

Please posts responses here, or send them to me directly at cantrell@macromedia.com. Thanks for your time!

Debate: The Best Way to Invoke Custom Tags

How do you invoke custom tags? Do you use the CF_MYTAG approach, or do you use CFIMPORT? I started out using the CF_ technique, but now I find I prefer to use CFIMPORT for the following reasons:

  1. I like the flexibility it gives me in terms of where I can put my custom tags (without having to create mappings).
  2. I like the ability to create “packages” or groups of related tags, which allows me to reuse tag names.

The Jimg project from DRK 4 comes with a set of custom tags for image manipulation: border, crop, draw, fill, height, load, pattern, rotate, save, scale, scaleToAtLeast, sequence, size, text, tint and width. I certainly wouldn’t want to copy all those tags in my CustomTag directory and take the chance of overwriting existing custom tags. Rather, I copy create a directory called “jimg” in my /cf_tags directory, and import them like this:

<cfimport taglib="/cf_tags/jimg" prefix="img"/>

Then, I can use the tags like this:

<img:sequence>
<img:load .../>
<img:scale .../>
<img:save .../>
</img:sequence>

What’s your preference, and why?

Separating Sessions From Cookies

Cookies are a great way to pass around session identifies (CFID, CFTOKEN, and jsession values), especially when they are managed seamlessly by the server, saving developers a great deal of time and hassle. So if the process works so well and makes developers’ lives so much easier, why would anyone choose to manually encode session identifiers into all URLs and form action values? There are two reasons:

  1. People who have cookies disabled can still use your application just like people with cookies enabled.
  2. Users can use multiple browser instances to log into multiple application accounts simultaneously.

#1 is pretty straightforward, but #2 requires some additional explanation.

If you use cookies to automatically manage sessions, when a user opens a new browser instance and goes to your application, all the domain’s cookies get sent, and you automatically join the same session that is active in the other browser instance (unless you use an entirely different browser as opposed to just a second instance of the same browser). If you have setClientCookies set to “no” in your Application.cfm file, however, and you use the urlSessionFormat function to encode the session identifier into links and form action values, when a user goes to your application in a different browser instance, they will receive an entirely new session, and can easily maintain both session simultaneously.

If you decide to go this route, I would actually recommend not using urlSessionFormat, at least not directly. A better solution is to write you own version, and use your UDF everywhere instead. That way, just by changing one function, you can add or remove arbitrary parameters that get passed around your entire application. For instance, maybe you have a concept of a role or an affiliate, or something that you decide you want every page in your application to be aware of outside of the context of users’ sessions.

This may seem like a lot of trouble just to allow the occasional user the luxury of maintaining two sessions at the same time, but it’s actually a nice hook to have and can sometime get you out of corners you have inadvertently backed yourself into.

eWEEK Reviews ColdFusion MX 6.1

Yesterday, eWEEK published a review ColdFusion MX 6.1. Some highlights:

… although the server and the development engine moved to Java, site developers were still able to take advantage of ColdFusion’s excellent CFML (ColdFusion Markup Language), which remains the easiest-to-use Web scripting language that eWEEK Labs has seen.

In eWEEK Labs’ tests, Version 6.1 outperformed the previous version at all load levels.

These prices are higher than those of previous versions, but they are very low when compared with most enterprise application servers…

Using ColdFusion with Java 1.4.1 on OS X

JRun and ColdFusion MX 6.1 work just fine with JRun on OS X using Java 1.3.1, which is good, since, as far as I can tell, there’s no way to get it to work with the newest installation of Java, which is Java 1.4.1 (if you know of a way, please let me know). If you are not intermingling Java and ColdFusion too much, it’s a great setup, but what do you do when you need the combination of ColdFusion MX 6.1 and Java 1.4.1 and OS X? According to Sean Corfield, the answer is Jakarta Tomcat. I installed Tomcat this morning, and so far, so good. If you need access to 1.4.1 and you are working with ColdFusion MX 6.1 on OS X, Tomcat currently appears to be your best option. Macromedia even provides a set of ColdFusion installation instructions for Tomcat.