Technology Convergence

Ever since The ColdFusion Podcast first came out, I have thought that I would like to listen to podcasts about ColdFusion. Despite my intentions, however, it hasn't really happened.

The ColdFusion Podcast has been inactive lately (though they plan to start again next year), but ColdFusion Weekly has been brodcasting pretty regularly. In the past several months, however, I have listened to only one or two podcasts from each.

Basically, I am unable to listen to a podcast while I work because it is to distracting. If I am not working, then I am usually spending time with my wife. Since she is not a programmer, it seems rude to make her listen to a podcast about ColdFusion.

Ideally, I would listen to a podcast on the drive. A few things prevented this, however - an unwillingness to wear headphones as a drive and a lack of an MP3 player in the car.

Thankfully, a combination of factors has finally solved this. My wife and I recently went to NYC for a brief vacation. While there we picked up a new iPod Nano for my wife to replace her iPod Shuffle (at the Apple Store of course!). This means that I have an iPod Shuffle now (I love leftovers! - product of being the youngest siling, I suppose).

This summer we bought a new Honda Element (not so flashy as the Mini Cooper it replaced, but more useful and still lots of fun).

The Element has an auxillary input, the result of which is that I can listen to the iPod in the car while driving. I did just that today on my drive out to the post office. The drive was only long enough to get through about half of the most recent ColdFusion Weekly, but it was still really nice.

It really felt like I was just listening to a normal broadcast radio show on ColdFusion. In many ways, new technology has the same feel as the old. The major difference is that network radio is unlikely to cover ColdFusion programming, so niche markets are well served by technology that makes content production and distribution.

I look forward to hearing more of both podcasts in the future.

  

cfdiff

I have some custom tag sets that have recently started to fork into different versions - not good for easy of use or maintenance. I wanted to coalesce them into one master version (in hopes of releasing a beta soon). Unfortunately, unifying three versions of several files (some of them quite large) represented a bit of a task.

I started this task in my usual way, but opening up two versions of each file and going through them screen by screen. It didn't take me very long to think that my time was too valuable for such a boring task. It seemed like the sort of thing that could be automated. Then I remembered a blog entry by Rick Osborne about cfdiff - a tool to do just what I was doing.

I'll start with the bad news.

Not yet being an SVN person (soon! honest!), I found the Google Code page for cfdiff difficult to use. I really just wanted to download a zip like I can on RIA Forge (where I would love to see this project move).

I wasn't able to find any documentation for the project. I saw a screen shot of a really nice report on Rick's page, but I couldn't figure out how to produce it with his code. Without documentation, I was hoping to find an example implementation of the code (I find that often all I need). Of course, this means that I really need to look at some of my projects, like DataMgr, and add a file in the download with a bit of explanation. In my defense, I have the CFC docs and some presentations available.

Now on to the good news.

Although I am not yet an SVN person, I was able to put in the SVN url in my browser and download the files individually. It wasn't my preferred approach, but nor was it a major inconvenience.

A short look through the code, turned up the DiffFiles method. This method was easy enough to understand. You just pass in the full path for each of two files that you want to compare as well as the carraige return character (though it does have a default for this). It returns a query that you can dump on your page.

This wasn't as attractive a result as I was hoping for, but no less useful for that. It provides the line number for each file where a difference can be found. It has to provide two line numbers because it does a good job of identifying two lines as being the same even if they are in different line numbers in different files (due to differences earlier in the file). This made going through the files fast and easy.

It seems to always report the line after the last line as a difference. This isn't really a problem because it is easy to get used to. In fact, it is somewhat nice because if you get an empty query, you can bet it wasn't able to find one of the files.

All in all, cfdiff saved me a lot of time and found differences that I may have missed had I tried to compare the files by hand. 

CodeCop and Layout Components

CodeCop has reached release candidate stage. I am still not thrilled with my installation code, but it works pretty well. It also makes for a good example of using several of my components (including layout components and DataMgr).

CodeCop will check your code and report possible problems. The rules that it uses to determine possible problems are completely configurable from within CodeCop itself. You can also share rules packages with other developers (I am hoping to set up a place to facilitate this sharing on my site soon). 

If you have a suggestion for keeping the installation as clean and user-friendly as it is, but make the code cleaner, I would be interesting in hearing it (look in install.txt to see the installation instructions).

CodeCop uses the DataMgr 2.0 (which is still in Beta - hoping to get that into release candidate stage before the end of the year) as well as layout components.

I hope to have a full entry on using layout components out later this week (was hoping to include that in this entry, but running out of time). 

Flex Conference for $100

If you are learning Flex (as I am just starting to), this may be the best opportunity to interact with other Flex developers and improve your skills.

The 360Flex Conference costs only $100 (thanks to sponsors). It will be from March 5th to march 7th of 2007 at eBay's Town Hall Center, San Jose, CA.

I really hope that I can make it to this conference, it looks like a great opportunity.

Register for the conference (and view a speaker list).

Keep in mind that registration is limited (20% have already been sold as of this writing), so don't buy a ticket unless you are really going to go. If you want to go, however, buy a ticket soon. No hotel block as been reserved, so hurry up and take care of that as well if you are going.

I hope to see you there!

Managing the UI

Peter Bell has an interesting series on "Architecting Your Views". As usual, his thoughts are very interesting and inpsired me to share my own views on the matter.

Peter starts by referencing my article on layout components and then describes his requirements for a CMS. In brief, they are:

  • Page Templates
  • Multiple Dynamic Content Areas
  • Reusable Screens
  • Extensible UI Components
  • Snippets
  • Separation of Concerns
  • Declarative Specification

I think that the distinction between a CMS and a site layout is an important one. Layout components can help with some (but not all) of these requirements. Many of them, however, are outside the scope of what your layout mechanism should provide.

Layout components can help with page templating by providing an easy mechanism to switch to a different layout.

In order to use my "Home" layout (as opposed to, perhaps, my default one), I add the following code above my call to the layout component.

<cfset layout = layout.switchLayout("Home")>

No reason why that couldn't be a dynamic value from the CMS instead of a hard-coded "Home" as well. 

Most of the remaining functionality isin the domain of the CMS, but I do want to touch on a few other points that I will combine in one basic topic.

Snippets and Extensible UI Components are both reusable visual elements. Peter uses a Render component while many other people use custom tags. I think this brings up an important distinction. Some UI components are inherently general in purpose while others are intrinsically tied to the layout.

For example, every administrative section I have worked on needs tables and forms with similar functionality. As such, I have custom tags to manage each (available on my site, but still need to be cleaned up a bit). On the other hand, a given site may have a small calendar widget that will be used in various places throughout the site. It won't be used on other sites, but will need to be used in various places on this one.

In that case, I often add a method to my layout component. In this example, I would add a calendar() method which would render the calendar component. This also allows the calendar method to be extended for different layouts. For example, it might show up in the Home or Default layout, but not the layout used for outputting to MS Word.

I think that the Render component idea has some promise, but also may be more complex than is often needed. Most significantly, however, I think the distinction between general UI components and components that are essentially a part of the layout is an important distinction.

Incidentally, if you would like to see a full-fledged example of layout components at work, check out CodeCop (which will also review your code and which - thanks to layout components - looks right in CF6 admin, CF7 admin, or on its own). It is still in beta, but makes for a pretty good example of layout components (as well as the previously mentioned custom tags).

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.