"

Rusty Badger

Sometimes It’s Just Not Worth Gnawing Through The Straps!

About Rusty Badger

Random scribblings from Cliff Pearson.
ColdFusion Developer, Musician, Gadget fanatic and Geek!

Actually there’s nothing wrong with custom tags – I’m quite a fan and have used them quite a bit during my time as a CF developer.  The problem in this particular instance is the time it’s taking to implement them.

I’m working on some code that determines the IP address of a given piece of equipment.  This is currently driven by a series of queries, several arrays to contain the values and code like ‘#ip_inside[4]#‘ in the CFM pages, which are pretty cryptic and not easy to read.

We recently updated another area of the application to get the IP addresses in a different way.  This change reduced the run time for a specific report from several hours to 3.5 minutes (so I’m quite pleased about that – especially as this was on my first day!  Great first impression!).

My task now is to update these diagram pages so they use the same method to determine the IP addresses – hence the custom tag.

This CT takes 4 parameters, like so: <cf_getIPAddress subnetcode=”encr” vlan=”1″ compsub=”1″ comptype=”5″>.  Using these 4 parameters, the CT will return the IP address of the component, along with any component-specific labels (such as a prefix of ‘Virtual’ for certain components).

The problem is that I have to put this code snippet into 30 different files, with a total number of 1,116 insertions!  That in itself is a lot of work, but when you consider that for each of these I also have to update a DB table (as one of the parameters isn’t currently recorded), insert the CT code, check and update the four parameters, save, upload and test, the task grows exponentially.

It’s taking about 2 minutes per insertion, so by my reckoning, it’s going to take about 37 hours to complete what my boss and I both thought was going to be a fairly simple task.

I wonder how long it will actually take?  I’ll report back when I know.

One Response to “Custom Tags are your friend … sometimes.”

  1. Quick update: I created a snippet in CFEclipse to speed up the CT insertion task (thanks Mark!), so it’s taking just over a minute per insertion.

    Also, by doing the DB work in a batch before starting each page, I’ve managed to shave off a few seconds there too.

    Having said all that, I spent most of yesterday evening with an Evil Killer Robot(TM) headache – all I could see were IP addresses! B-< I think some time away from this task is called for.

    Cliff Pearson

Leave a Reply