May 272011
 

I’ve been looking at a few different ORM implementations for ColdFusion, including the native ColdFusion 9 implementation and Transfer ORM, and I’m having a hard time wrapping my head around the benefits of using it.  I understand that you can write things once, and then use that same code to connect to just about any database, but it also seems like an additional layer of complexity and abstraction that doesn’t provide many other benefits.  Especially in the case where you’re not planning on interfacing with more than a single database type, it seems like a significant burden to not only create your database objects, but then recreate them in an ORM.

To clarify, I’ve been using ColdFusion for about 7 years now, and I’ve worked extensively with mySQL, Microsoft SQL Server, and, most recently, four years with Oracle PL/SQL, and much of the work I do does not reference database tables directly, but calls (often complex) views and stored procedures to read and write the data I’m working with.  It’s usually no trouble at all for me to whip together what I need in the database and then call it from the ColdFusion code.

That said, are there any benefits to using ORM functionality that I’m missing?  I’ve read how much people enjoy working with it, but all I’m seeing as I read the documentation is more work without a whole lot of benefit (especially with how I’m used to working with my databases).

So, what’s so great about ORM?

May 152008
 

Ever want to store a value in a database as a decimal value, but then display that value on your ColdFusion website as a fraction.  Well, now you can!

The following function (cut out of a more general CFC) does just that for fractions as precise as 1/100, and will handle the whole number parts as well (i.e. displaying “1.25″ as “1 1/4″). 

<cffunction name="displayFraction" output="false" access="public" returntype="string" hint="Generates a fraction from a decimal.">
    <cfargument name="formatThis" type="Numeric" required="true">
    
    <cfset wholePart = int(formatThis)>
    <cfset fractionPart = (numberFormat(formatThis,".999") - int(formatThis)) * 100>
    
    <cfif fractionPart NEQ 0>
        <cfloop from="2" to="100" index="d">
            <cfif (round(fractionPart * d) MOD 100) EQ 0>
                <cfset denominator = d>
                <cfset numerator = round(fractionPart * d) / 100>
                <cfbreak>
            </cfif>
        </cfloop>
    </cfif>
    
    <cfif wholePart GT 0>
        <cfset fraction = "#wholePart#">
    <cfelse>
        <cfset fraction = "">
    </cfif>
    
    <cfif fractionPart NEQ 0>
        <cfset fraction = fraction &amp; " #numerator#/#denominator#">
    </cfif>
    
    <cfreturn fraction>
</cffunction>

I wrote it for a recipe storage application for personal use, and thought others might find it useful as well.  If you do find a good way to use it, feel free to drop me a line!

Apr 062008
 

A few weeks ago I started trying out the ColdBox Framework for ColdFusion.  I have to admit that at first I found it confusing, because it's approach to development was so much different from the previous approaches I had taken on my own and at work.  It hasn't helped that I haven't had an overwhelming amount of development time at home to work with it, but so it goes. 

However, now that I'm getting my head around it's approaches, I'm beginning to figure out just how to work within it.  The use of events and views and their separation is becoming more familiar, and really make sense.  Instead of having code for events in the top part of each one of my pages, I can now keep it separated, which should help me to maintain easy to read and maintain code.

As I continue to work with ColdBox, I plan on writing here about my experiences.  So if you're interested, come on back and see how it's coming.

Jan 242008
 

lastplayed_example Are you a Last.FM and BlogCFC user who doesn't want to bog your site down with  bulky flash applications, but still display the music that you love?  Well, then Last.Played is the BlogCFC Pod for you.  Easily display the song information and album art for the music you have most recently listened to, and even generate income by linking to Amazon product pages!

Last.Played Homepage

Mostly, this was just a fun little project to create something I wanted, and I hope others can make use of it as well!

Nov 022007
 

Well, after several months of just having the time to make the changes to my homebrew blogging solution, I've decided to make the move to Ray Camden's BlogCFC.  Part of this was because I wanted to have more time to work on other projects, and part of it was to make writing to my blogs easier on myself.  So, I've made the move with both this blog and my one over at IfJesusHadAWebsite.net

I'm sure I'll be making a number of tweaks to the look and functionality of the site.  I've already made a few changes to have both blogs run on the same instance under different URLs, maintain separate pods (or the blocks over on the right), and work smoothly with Gmail for Domains available through Google Apps (thank you CF8 and useTLS).  Oh, and while the old URL's won't work any more for posts and such, they will dump you out on the main page.  However, the feedburner feeds have been updated, so you won't miss anything if you've subscribed.

Hopefully, this will be a relatively smooth transition though.

Jul 062007
 

Well, this week I finally got a chance to play with my CF8 beta server, and I'm liking the new user interface tags. It's not that they do anything revolutionary, but they do the things that we developers need to do regularly with ease and consistency.

For example, the cflayout tags will help make websites with cleaner layouts. I heard someone remark that the same thing could be done with 3 lines of CSS, but I've probably seen around a dozen different ways to create what looks like the same layout using CSS. Cflayout will allow teams of developers to more easily get on the same page and do things more consistently.

The cfpod tags seem a little goofy, but allow for small contained parts of pages that can be refreshed.

Probably my favorite part so far is the cfwindow tag, which allows for the creation of a floating window over the page. The reason I like them is because we use a lot of modal windows where I work, and we've got a series of large javascript files to manage them (which have gotten a little unwieldly over the years). With the cfwindow tag, we can eventually replace this design with just a few lines of ColdFusion code.

The only part I'm getting used to is the ColdFusion-ized javascript calls for refreshing parts of a layout, a pod or a window. It just seems less straight-forward than most ColdFusion code, but I guess we're a bit spoiled in that aspect. I'm sure once I'm used to it, it will become second-nature like most of the rest of the code is.

All in all, I'm seeing some very positive changes being made to ColdFusion so far, and I'm looking forward to exploring it further and start building full apps in it.

Jan 292007
 

I got this from Ray, who got it from Tim, and I thought I'd follow suit and throw my hat into the ring with this meme. It's supposed to be a way for Adobe to learn a little more about their ColdFusion clientelle, so here's my contribution:

  • 27 years old

  • Married for a year and a half, no kids yet

  • Drives a 1998 Toyota Camry, maroon

  • Lives in an apartment, a nice two bedroom. Decorations are hard to classify, but are heavily influenced by functionality and the IKEA catalog.

  • Has strong allergic reactions to Macs and can't stand the Mac/PC commercials (too many broad strokes and false statements). Likes UPS Whiteboard commercials, because they are just straightforward.

  • Didn't see a single movie nominated for the Oscar for best picture, but was generally disappointed in many movies this year anyway. Still want to see some on the list, though, including: The Last King of Scotland, The Departed, and Children of Men.

  • Into LOST, 24, Law & Order (any), and Mythbusters. Also enjoys Iron Chef from time to time.

  • Like playing hoops, swimming and rollerblading, but never have enough time to do them.

  • Food? Wings, pizza, steak, Chinese, and Indian make the Top 5.

  • Music? I like a little of everything, but focus mostly on Alternative, Rock, and Christian Rock. My Last.FM profile gives a pretty good depiciton of my tastes.

  • Can lose long periods of time watching Top Gear clips on YouTube.

 

Jan 202007
 

Well, I'm making another change on the job front in the coming weeks. Today, I accepted a position at Northrop Grumman and gave my notice at EFS. I'll finally be getting back to ColdFusion development after working the last 10 months focusing on Database Administration. I'm really looking forward to the change.

I can't say anything bad about my time at EFS. It's been a great experience in getting to learn more about business after coming off of working at an academic research study, and I've enjoyed working with everyone there. However, I really wanted to get back to developing in ColdFusion, which was the main motivation behind the change.

Looking forward to seeing where this move will take me!