Category: ColdFusion

onMissingMethod Issue Cleared Up

At LandsofAmerica I've been making extensive use of the onMissingMethod() functionality of CF8 to provide implicit getters and setters. This has worked fantastically well, and I'm never going back to explicitly declaring these unless I have to :). But one problem I've had was with using my implicit getters and setters inside my objects. It just didn't work... My onMissingMethod() functionality is wrapped up in a base decorator object that all of my base objects extend. It looks like this: So within my objects, if I called getSomeValue(), I would get an error that method didn't exist (duh, that's why I have onMissingMethod()). For the life of me I couldn't figure out a way around it, so I just started calling get("SomeValue") while I was inside an object. This was workable, though not necessarily ideal. It means that if I refactor a particular method to make it explicit (by creating a getSomeValue method), then I would need to go through my object and replace all of the get("somevalue") calls with getSomeValue(). Well Ben Nadel just made a post on his blog, Comprehensive ColdFusion Component OnMissingMethod() Testing that solves the problem... When calling an objects internal methods, if you always THIS scope them, then onMissingMethod will fire like it's supposed to. Thanks Ben, now I have to go through and do all of those find/replaces ;-)
0 comments | Posted by Daniel Short on Nov 19, 2008 at 8:52 AM | Categories: ColdFusion -

I Love MXUnit

I just thought you should know that...

MXUnitPass.png

Get your own dose of lovin' at MXUnit.org.

3 comments | Posted by Daniel Short on Sep 26, 2008 at 9:22 AM | Categories: ColdFusion - Rambling -

Unplug your friends

A ploy by Meetup to try and get me to go outside, Unplug your friends is a clever way to let the geek in your life know that they're getting pasty and pale... Get those geeks some Vitamin D!

(Via LifeHacker.)

0 comments | Posted by Daniel Short on Sep 8, 2008 at 12:14 PM | Categories: ColdFusion - Rambling -