Thursday, August 26, 2010

Technical Debt: If You Can't Handle Change, It's Time To Change Careers

Change happens every moment. Right now things have changed just from the second before. This means all things in life are fleeting. Not changing is like trying to hold on to the present as it becomes the past. Why should we hold on to the past? We should not. Nobody has every succeeded at this and you should not think that you're special enough to think you will be the first.


Change is good. It should not have negative thoughts connected with it. Change will happen whether we like it or not.  We might as well learn something new so we can adapt to change in ways that do not cause us suffering.  The scariness of change can be counteracted with learning. Learning something will lessen any suffering that occurs from change.  In the terms of IT, you'll live a happier IT existence because you will not accumulate massive amounts of "technical debt" by not changing and therfore not learning.  Doing things in the "tried and true" methods don't always mean you're doing it right.


So take the plunge and make a nice down payment on the change that inevitably comes. Learn something new every day.  Or if you want a different explanation in clearer wording: How can you be in IT if you don't want to learn new stuff? If you don't want to learn, you're in the wrong business.

Wednesday, August 11, 2010

CFML Function - createDatetimeFromHttpTimeString()

Working with HTTP time strings should be easier to CFML / ColdFusion,
but there is no built-in function that will create a CFML date/time from
a UTC HTTP time string. So here is the UDF that can help you work with
HTTP time string in native CFML date/time functions. I didn't check
cflib.org first, but I really couldn't check it out of professional
courtesy because I was writing this function for open source project and
I didn't want to deal with attribution / license stuff (yes, I'm lazy).





<cffunction name="createDatetimeFromHttpTimeString" access="public" returntype="date" output="false"
    hint="Creates an UTC datetime from an HTTP time string.">
    <cfargument name="httpTimeString" type="string" required="true"
        hint="An HTTP time string in the format of '11 Aug 2010 17:58:48 GMT'." />

    <cfset var rawArray = ListToArray(ListLast(arguments.httpTimeString, ","), " ") />
    <cfset var rawTimePart = ListToArray(rawArray[4], ":") />
   
    <cfreturn CreateDatetime(rawArray[3], DateFormat("#rawArray[2]#/1/2000", "m"), rawArray[1], rawTimePart[1], rawTimePart[2], rawTimePart[3]) />
</cffunction>




Enjoy!

Thursday, August 5, 2010

FuseboxFramework.com Domains Are Going Away Soon...


Where did you get those URLs? The fuseboxframework.com domains are going
away soon (because no one in the Fusebox community was interested in
taking them on - and they expire in two weeks).

via groups.google.com (a comment by Sean Corfield)

This is in reference the domain being used by the what appears to be the "defunct" FuseNG project that forked from the Fusebox project. While these aren't the main fusebox.org domains, this prompted me to look at the status of the main Fusebox project.


I was surprised to learn that the last stable release for Fusebox was in March 2008 (version 5.5.1). Has it really been that long? It will be 2.5 years ago in just about a month or so without a release is stunning. Time flies.  Also, I quickly checked the Fusebox Trac site. Only one new ticket other than spam tickets has been filed or commented on in the past 6 months and that one ticket is just a question on syntax (it should have been sent to a list).  What is the state of Fusebox these days? Is TeraTech really "driving Fusebox forward and you can expect to see major improvements to the web site and the documentation in due course"? I don't see evidence of it on the site.


What really saddens me is the state of the CFML community. Have people not learned to pitch in and help their open source projects? Clearly not because there is still the glut of new one-man projects that never leave the ground or barely hover. CFML community members need to band to together instead of re-inventing the wheel. They need to learn to contribute (which I'd say that 99.9% of them do not) and realize that there is only a handful of people contributing to their open source project of choice. You don't have to pay for software with money; you can pay with your time, talent and expertise. Contributing does not always mean code but help on lists, documentation, sample applications, etc. There are so many things to do on open source project other than the next generation of code.


This is a call to arms! If you use open source, donate some time back to it or you might sadly find yourself with a defunct project and no maintainer there to help you. The great news is you can save yourself by contributing your time now. I urge all CFMLers to donate just 30 minutes a week to ONE project of your choice (if you don't know what to do, contact the maintainers -- I'm sure they have a laundry list of things to do). Just 2 hours a month would change the state of affairs in the CFML community and propel our language forward.


Monday, August 2, 2010

CounterMarch Systems Blog: Mach-II is (still) awesome



Mach-II rocks. It is one of the more "mature" surviving ColdFusion application frameworks, and as such doesn't get nearly the amount of buzz that the new (interesting, different, creative, awesome-in-their-own-way) frameworks get. If you're looking at frameworks, I encourage you to take a look at the amazingly capable Mach-II - we've had fantastic success with it!

Things I really, really like about Mach-II:

Backwards compatibility


Take an old (Mach-II 1.1 app, circa 2006) and update the framework to 1.8 (released 2009). Replace the application.cfm file with application.cfc, comment out everything in index.cfm and *boom*...you're done. I can't really assess how challenging it is for the team to maintain backwards compatibility, but I sure do appreciate how simple it is to upgrade. Instant feature add with zero headaches.

Coldspring integration


<include file="./mach-ii_coldspringProperty.xml" />

and in your listeners:

<cfcomponent name="mpListener" extends="MachII.framework.Listener"



depends="howConfigManager,mpManager,reportManager,notificationManager">

I don't think it gets much easier than that. Instant Coldspring integration for dependency injection (and more), radically simplifying the configuration of all of my listener and model cfcs. Now we've got all the power of Coldspring cleanly available to our Mach-II application.

Faster Fixes


Knowing where to find things is one of the hallmarks of any good framework. Some do it by convention, some by configuration. Mach-II falls into the latter camp but that's perfectly fine by me. Getting back into the mental model of an application months (or years) after deployment is a challenge but by simply cracking open mach-ii.xml I can see what happens where within seconds and bend it to my will. I love this.

Modularity


This wasn't in the framework back in the 1.0 and 1.1 days (when we created some mammoth apps), but by 1.5 (which came out in 2008) the ability to break up large Mach-II applications into separate modules was baked in and oh-so-handy. It's two years later and we've been able to make the easy changes to break those older apps into a collection of modularized sub-apps for much easier maintenance. Perfect example is an extranet: lots of only slightly related apps put under one common umbrella sharing security or UI components. This is easy to implement and support in a well-designed Mach-II application. All of our more recent apps make use of this feature.

The Team


The people who created and have since improved and evolved Mach-II are some of the smartest folks who are or have been involved in the ColdFusion community. Look at this list. Not only have they created something awesome, but they're incredibly responsive on the wiki, development Google group, and framework users Google group. They use this framework at their day jobs so you know that each release has been painstakingly designed, implemented, tested, re-tested, piloted and then released. Plus, they're open to new ideas (even if you personally have no idea how to make them happen!). Code is great, but the people are the best.

The View Loader


This is where some of those "convention-based" concepts have crept in to Mach-II much to the benefit of the users. Back in the "bad old days" your mach-ii.xml file would contain a block that looked sorta like this, except far longer:

<page-views>
      <page-view name="showWelcome"       page="views/showWelcome.cfm" />
      <page-view name="showHome"       page="views/home.cfm" />
      <page-view name="baseTemplate"       page="views/baseTemplate2010.cfm" />
      <page-view name="blankTemplate"    page="views/blankTemplate.cfm" />
      <page-view name="welcomeLanding"    page="views/welcome_landing.cfm" />
      <page-view name="showSendPassword"    page="views/showSendPassword.cfm" />
      <page-view name="showAppHelp"       page="views/showAppHelp.cfm" />
   (and so on)

Each page would have a page-view defined. Someone called shenanigans on it and now we have the PatternViewLoader to replace ALL of it!

<page-views>
   <!-- This would load all views with the pattern of "/views/**/*.cfm" which is the most basic and common pattern -->
<view-loader type="MachII.framework.viewLoaders.PatternViewLoader" />
</page-views>

So, so simple. Love this line of the config file more than any other.

Better apps, faster.


Take Mach-II off the shelf and use it as your "glue." Add Coldspring to manage your model. Use ColdFusion 9's new Hibernate ORM capabilities to cut the lines of code in your model by a huge factor. Redirect some of the saved time into building a better UI using jQuery, improving your cross-browser capabilities with clean CSS and making your client happier by communicating more frequently. Result: a better app, designed to be maintainable and much more in line with your client's spoken and unspoken expectations. How could any craftsman not feel good about that? Mach-II is a key component to that successful formula for us.

Try Mach-II. Need help? Talk to the team on the list. Build great things.



This exactly what Team Mach-II likes to hear. Thanks for the shout out Steve!