An Architect's View

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

An Architect's View

Entries for month: November 2003

CFCDev is a *great* mailing list!

November 27, 2003 ·

I continue to be more and more impressed with the discussions on CFCDev, the listserv run by the CFCZone crew. Recently there's been a lot of discussions about patterns and OO design so if you're serious about improving that aspect of your ColdFusion programming and really getting into CFC development then you should sign up!
A recent example was a question posed by Justin Balog about applying the memento pattern to objects that use composition. He was concerned about the additional complexity composition seemed to add. Paul Kenney responded with a code example that showed how simple it can be in reality - the enclosing object's getMemento() simply calls that method on each of the enclosed objects and constructs a composite memento from the results; similarly setMemento() does the reverse, calling setMemento() on each enclosed object. I think it's great to see questions like this posed and answered by a group of folks determined to help improve each other's design and programming skills, and who are so open to the great wealth of OO material out there (for other languages).

Tags: coldfusion

Accessible Australia Tour - December 2004

November 27, 2003 ·

Macromedia's own accessibility guru, Bob Regan, is doing a series of gigs in Australia talking about building accessible websites using Dreamweaver MX 2004. If you're downunder and have an interest in accessibility (especially if you're in government, I guess), then this is for you!

Tags: adobe

Brandon on Database Drivers

November 26, 2003 ·

Brandon Purcell has two great blog entries covering the configuration of database drivers for MySQL and SQL Server 2000 with ColdFusion MX.

Tags: coldfusion

Martin Fowler on Domain Model Design

November 25, 2003 ·

Martin Fowler has spotted a worrying trend in domain model design - anemia! That's his term for domain models that have no logic in them - where all of the logic has migrated to the service layer. His point is that the service layer should be fairly thin and the business logic belongs in the domain model itself.
This will be of particular interest to Mach II developers because, whilst the framework mitigates against putting too much logic in the controller portion (the XML file), you can still bulk up your listeners as a service layer and end up with too much business logic in your listeners - instead of down in the domain model where it really belongs.
If you read the Designing Models section of the Mach II Development Guide, you'll see that it recommends separating your business model (the domain model) from the Mach II framework so that your listeners don't end up full of business logic.

Tags: programming · architecture

What is Sean doing?

November 21, 2003 ·

Well, you've probably guessed that (a) I'm not at MAX and (b) I'm doing a lot of work with Mach II and you'd be right on both counts. Why didn't I go to MAX? A bunch of reasons (mostly personal) and it's worked out well since I'm very busy on an overhaul of some of our enterprise systems. My role is "integration architect" and I'm actively working on a number of the touch points between the various systems and various vendors. We've got a slew of legacy file formats and we're trying to standardize around XML and OAGIS. And ColdFusion is proving very useful!
Some of the things that ColdFusion is extremely good at include manipulating XML, interacting with databases and, because of tags like
cffile
,
cfftp
and
cfhttp
, manipulating and converting files from various locations. As part of the integration work, I'm building Mach II applications that can process legacy file formats, convert them to standardized XML formats, import XML documents into the database and export and post XML documents from the database. Converting data to XML is an absolute breeze with CF because once you have the data in some data structure, you can just say:
<cfsavecontent variable="xmlDoc">
<cfoutput>
<?xml version="1.0" standalone="no"?>
<!-- generate the XML here -->
</cfoutput>
</cfsavecontent>
Processing the inbound XML is only slightly harder. A call to
xmlParse()
followed by some struct / array manipulation and you've extracted all the data you need, a quick
cfquery
and it's tucked safely away in the database.
The RAD capabilities of ColdFusion allow me to explore several scenarios for each data feed to see what works best so that I don't get stuck with expensive development of the wrong solution!

Tags: coldfusion

Mach II - In Anger

November 21, 2003 ·

I've mentioned a couple of times that Macromedia is using Mach II internally to build applications for macromedia.com. Indeed, a couple of small applications are already live (one is the content admin for the Active Content Resources application in Central, the other is the Breeze trial request form). We're actively working on a couple of high-profile, high-traffic applications as well and right now we're in the load testing phase. As we've hammered the applications, we've uncovered a number of thread safety issues in the core Mach II files and we have fixes for all of the problems we've found so far (mostly adding var declarations for variables that are only used locally). I'll be working with Ben Edwards and Hal Helms to produce a new release of the core files that addresses the problems we are finding in load testing - the result should be a rock solid framework that can stand extremely high traffic!
This exercise has shown how vitally important it is for you to think about using var to declare local variables. If you omit var, you'll be storing data implicitly in variables scope which persists for the lifetime of the component instance - this is often not what you intend! There's a few places where it's easy to miss a local variable that you need to pay special attention to:
  • cfloop - the index or item variable
  • cfinvoke - the returnvariable
  • cfquery - the name variable
Those are almost always going to be local variables so they should all be declared with var at the top of your function!

Tags: coldfusion · machii

Blackstone

November 20, 2003 ·

The next version of ColdFusion, codenamed Blackstone, received some exposure at MAX with a good summary on Rob Brooks-Bilson's blog. The main themes mentioned in Rob's blog are more sophisticated form handling and generation, including Flash forms, and printing & reporting functionality built around document generation. Guess we'll have to "watch this space" since none of those features are set in stone at this stage of the lifecycle...

Tags: coldfusion

Central & Mach II

November 20, 2003 ·

Mike Chambers blogged case studies for two of the new Central applications - the Movie Finder and the Active Content Resources application. The Movie Finder is very impressive and very useful. The Active Content Resources application is much simpler but it is dearer to my heart because I wrote the back end!
It's a ColdFusion application, in two parts: a web service CFC that is called by the Central application and a content administrator. The content administrator is a Mach II application that manages "articles" and "categories" (the article CFC, DAO and gateway are featured in the Mach II Development Guide as example code). The web service CFC calls the article gateway CFC to return recently published articles. The Mach II application has two listeners, one to manage interactions with the article-related CFCs and one to manage interactions with the category-related CFCs. It allows Mike, Diana and others to quickly add and edit summaries and links for breaking news about Active Content issues, so the information can be delivered directly to developers via the Central application!

Tags: coldfusion · mx · machii

MXDU - Shaping up Nicely!

November 20, 2003 ·

The agenda for MXDU is shaping up nicely now with three tracks covering client, server and experience themes. I'll be speaking in the server theme (of course!), talking about Macromedia's use of Mach II.

Tags: mx · webdu

MAX : CFCs Geeks of a Feather

November 20, 2003 ·

Rob Brooks-Bilson has a good summary of Ray Camden's Geeks of a Feather (informal) session at MAX. Like those attendees, I would rate interfaces high on my wish-list for CFCs!

Tags: coldfusion