Mach-ii Application Skeleton

Posted by Neil on January 16, 2008

Yesterday, I went to download the Mach-ii application skeleton, which you need to create a new Mach-ii app.  However, since the framework move to 1.5, the old skeleton has been the only one available (a 1.5 version is still in the works, but very close).

So, if you require the skeleton and can’t find it (it’s not overly clear), it can be found here.

All change! 2

Posted by Neil on August 15, 2007

So, what’s been going on with Feed-Squirrel recently? Well plenty thanks….

You may have seen a few days ago that Ben Forta had posted that feed-squirrel.com (my main aggregator site) had migrated to CF8. For me, this is a key step that the site needed to take in order for me to try some new and interesting stuff in the near future. But enough of that, let’s get into the nitty gritty of what’s changed…

  1. Overall performance. Hopefully regular users will have noticed significant increases in the performance of the site. This is for a number of reasons
    • Coldfusion 8. Although it’s difficult to quantify, it’s make an improvement to overall speed.
    • Caching improvements - Lots more of the site is cached, meaning a lot less work required on the data tier (which is one of a not so nice parts of an aggregator)
    • No more Model-Glue - Now that may suprise a lot of you, but I’ve effectively gone for the anti-framework. All parts of the site are now built in a fairly bespoke way suited to performance and maintainability. There is still a central data object but everything else is split out in a very lightweight MVC style. This has meant that I have been able to get rid of a lot of the bloat that a complex framework brings, and reap the performance benefits. Also, I never really got on with Model-Glue. I found it got in my way.
  2. CFFeed. This tag alone makes my life a lot easier. Unless you’ve ever tried to write some RSS aggregation code you would not beleive how many different feed dialects there are out there. Out of the 1,200 odd feeds the site aggregates, I’ve come across around 1,200 different ways of presenting feed data. It would appear Atom vs RSS is only the top of the iceberg. You may notice that some previously dormant blogs are now aggregating successfully….This is down to CFFeed.
  3. CFThread. Another superb tag. Right down in the bowels of this site is some import code, this code runs through every feed on a regular basis checking for new items. Due to the fact there are so many, CFThread now means I can check all the feeds on a more regular basis without having the long running requests that I previously would have had.
  4. CFLayout. Check out the “Watched Feeds” and “Create Custom Category” pages. These used to be one huge list of feeds. Now, by using the CFLayout tag, this page has been reduced in size greatly, and even makes it easier to find what you are looking for.

So, all’s good then. Well, as with all migrations there are small problems. I had three significant ones which were:

  1. Corrupt Table.This is an error that Coldfusion started returning was load was placed on the server. After some quick tracing, I tracked down the problem to cached queries. It appears that sometimes a cached query can go a bit screwy and force the server to return this error every time the cached query is used. Strangely I found that the error was still returned after I removed the cachedWithin attribute from the query. The only way I could find to get of the error was to flush all cached objects from the server with the CFObjectCache tag. Unfotunately I have not seen this since so I can’t really tell you anymore.
  2. Cannot create a new thread because the task queue has reached it maximum limitI started getting this error on the importer. A server restart was the only way to fix the issue and I’m a little unsure as to what the problem might have been. After thinking about it for a while I beleive that there is a thread limit built into CF and that that threshold had been met with entirely unresponsive threads. It would appear then that once this thread pool is full, CF just returns this error.
  3. CFFeed limitationsI said before CFFeed is a great tag, and it is, but for me there is one limitation. CFFeed can go off and retreive feeds for you, but for some reason Adobe have left out some of the key functionality of the CFHttp tag which is useful from a resilience point of view. Primarily is the timeout attribute - that the tag should stop trying to read the feed after x seconds. Secondly, CFFeed doesn’t play well with Http Authentication. Whilst in development, I uncovered a situation whereby CF was sat spinning a thread due to the fact that the CFFeed tag had tried to retrieve a feed that required Http Authentication. Instead of failing out as you’d expect, CF just sits there for ever and ever, never timing out, and never returning an error. As far as I can tell the only way to kill the thread is via a server restart. There is a workaround though. Simply use the CFHTTP tag to retreive the contents of the feed, before passing it into CFFeed to deserialize.

So, overall hopefully you guys find the site is more pleasent to use and some small touches make it more useful to you. When you consider that the site’s ground up re-write from blank to now took me around four hours, thats not bad going…

Now, on to the new features. Watch this space….

Yet Another Coldfusion Framework 5

Posted by Neil on February 19, 2007

After my earlier post remarking on the complexity of the current crop of CF frameworks (whilst realising their benefit 100%) I thought I would open up to the masses the framework that I have used for approximately the last six years that currently powers several heavily used sites hacross the net. Therefore, I have created the YACF (Yet Another Coldfusion Framework) project on Google code.

The project can be found here: http://code.google.com/p/yacf/

YACF is so stunningly simple, you’d almost be forgiven for believing that it is even a framework at all, it requires no installation, no configuration and can do anything you want it to. Not a single line of the framework is required and can be changed however you see fit. I will leave the details to the project page, but if you are desperate you can download the entire framework code from here:

http://yacf.googlecode.com/files/YACF_v0.1.zip

Currently YACF supports CF4.5 and up. If anyone has an earlier box still knocking around, I’d love to know if it works.

What is it with frameworks? 10

Posted by Neil on February 19, 2007

I’ve just been taking a look at a well-known framework that deals with command-driven code. Whilst having a read of the docs and seeing what’s what, I was thinking “this sounds handy, this could solve a lot of problems”. I then installed the framework, and was stunned when I was then looking through a multi-file/component lump of code that did a “Hello World!” example. Sure, these frameworks don’t shine when doing simple examples - but I am having trouble seeing where most of the benefits of frameworks lie.

A lot of these frameworks deal with abstraction of code so that code A doesn’t directly use/know about code B etc etc, when in reality what you end up with is the big bunch of files passing all sorts of variables and objects around to acheive things that could be written in Plain Ol’ Coldfusion (POC) in a matter of a couple of lines.

For instance, proxy objects. Why create code, that wraps other code when you could just make the location of the original code a configuration variable? Another one - why spend ages making a framework understand complex objects in configuration when again, you can just write it in POC nice and quickly without having to get bogged down in a framework?

Personally, I think we had it right around Fusebox 3-ish times. A load of MVC code all based around a central controller, and a config file (which was CF). No XML, no gateway objects, no framework loading, just a straight forward bunch of code that was easy to read and understand, simple enough to be Agile, and best of all extendable in whatever way you wanted (you just had to write the code).

Now, I’m not dismissing frameworks completely - Model-Glue for instance has it’s benefits, but personally I’ve never seen why anyone would want to get as complex as Mach-ii etc. Half the time, a lot of these frameworks appear to be code for code’s sake - a way of satisfying a coder’s needs as opposed to those of a more pragmatic programmer….

Bring on the flames….

Model Glue and Reactor, a winning combination

Posted by Neil on April 24, 2006

Just a quick reminder of the UKCFUG meeting this Thursday:

The Model Glue is a MVC (Model - View - Controller) based framework for ColdFusion applications. It provides a way to easily link your presentation layer (view) to your model layer by the use of controllers. Model Glue provides configuration and powerful control over over this “gluing” of your layers through XML files. Working along side it is the Reactor framework, a “Inline Dynamic Data Abstraction” API, which allows you to very quickly and easily access your database model without the need to write SQL or configure Data Access Objects.

In this presentation Mark Drew will be presenting what these frameworks are in detail (and what they are not!) and also develop from scratch a blog application using these two frameworks to demonstrate the power and speed that you can gain in your development environment.

Where:
Room U215, City University, Northampton Square, (main campus entrance), London EC1V 0HB.

When: Thursday 27 April 2006

* Doors open: 1800
* Meeting starts: 1830
* Meeting ends: 2030

Directions:
By Underground: Angel (Northern Line - City Branch) or Farrington (Metropolitain and City Line). By Bus: Routes 4, 19, 30, 38, 43, 55, 56, 63, 73, 153, 205, 214, 243, 274, 341.”

If you're going, see you there.

Model-Glue performance tweaks

Posted by Neil on April 20, 2006

Over the last few days, you may have seen people talking about a performance test that Webapper have run against a few of the more popular CF frameworks out there, namely Model-Glue, Mach-ii, Fusebox 4.1. Also included was a homegrown app from Simon Horwith.

The results? Well, not so bad, even if the showing from MG was by no means complete. As it turns out, after some more testing, Joe Rhinehart, the author of MG, has found a couple of low level bugs in the framework. Nothing drastic, just some bits that could be a bit cleaner.

So, the framework previously known as MG 1.1 is getting a revision. 1.1.01 is in the pipeline (and also in the MG Subversion repository for anyone wanting to test it).