In my recent review of Luis Majano's ColdBox presentation, I mentioned that I don't like Hub-and-spoke. I was asked for clarification on why Hub-and-Spoke doesn't work for me.
I should first start off by explaining what I mean by Hub-and-spoke (a term for which several definitions exist). By this, I mean the technique by which all requests go through a single file. All of the major ColdFusion frameworks that I have seen (Fusebox, Mach-II, Model Glue, ColdBox) use Hub-and-Spoke. Such an approach certainly makes Front Controller functionality easy. In fact, much of what those frameworks do would be impossible without it (at least prior to the introduction of onMissingTemplate in ColdFusion 8).
In a ColdFusion environment, Hub-and-Spoke generally means that all page requests are routed through index.cfm. Here are some examples of hub-and-Spoke URLs:
The last example leaves off the index.cfm, but it is still being used. As I said, this is helpful for a front controller, but can have some drawbacks. For my situations (which I will discuss as we go), these outweigh the benefits.
If you look at Hub-and-Spoke sites, you will see that their URLs don't look as "clean" as sites that don't use Hub-and-Spoke. For example, Great Biz Tools uses Mach-II and MySpace was originally built with Fuxebox. My own site, on the other hand, was built without Hub-and-Spoke (except for this blog).
It used to be that this structure could affect search engine rankings. That may not be the case now, but I still prefer a cleaner looking URL. This is, admittedly, a minor issue. It is more philosophical than anything: I just don't think URL structure should be dictated by framework choice.
Most traffic statistics software report traffic at least in part by page viewed. If you use Hub-and-Spoke, then it will report all views as being for "index.cfm". It is possible for some software packages to change the reporting so that it uses the URL variables that you use to indicate a page but that isn't always possible with every package and certainly adds extra configuration work where it is possible.
ColdFusion's built in error reporting and slow-running page reports indicate which page is running slowly or has an error. If you are using Hub-and-Spoke then this will return "index.cfm" every time. Although it is advisable to have an error catching routine the reports this information to you, I have found that it is still necessary to use the ColdFusion logs from time to time (if you have an error that cannot be caught at the code level or if your error catching routine has a temporary problem).
In my projects, I frequently work with designers who know some HTML. Although I do use a CMS in most of my projects now, I still find that there are situations where a designer will want to edit a file. On projects where I used Hub-and-Spoke, they found it very difficult to find the file that needed to be edited (even if I tried to be very consistent about the location and document it).
Now I don't use Hub-and-Spoke and I make sure that the HTML for a given page is in the file being called from the browser (if the page isn't managed by a CMS). This makes it easy for designers to edit the pages. I have gotten direct feedback about the difficulty of Hub-and-Spoke from designers, even though many programmers think that this won't add any difficulty.
For me, Hub-and-Spoke creates more problems than it solves. I create public facing sites wherein the site designers are generally heavily involved in the process. In most cases, the designer is my direct client so it pays for me to make their lives as easy as possible. If I were designing large, intranet applications my views on Hub-and-Spoke might certainly be different.