Home Contact

PD Versus-inspired Logophilduba.com

Adventures in Web Application Develompent by Phil Duba

Recent Entries

Popular Entries

Top Commenters

  • Nathan Mische (11)
  • Peter Bell (4)
  • Terrence Ryan (3)
  • Scott (2)
  • Jim Priest (2)
  • David (2)
  • Scott Stroz (2)
  • Scott P (2)
  • Justin Alpino (2)
  • Ravneet (2)

Slideshows

Pool Surprises...

Sponsored Links

Text Link Ads

Philly CFUG Dec. 18 Meeting Review

Posted On December 24, 2007 10:09 AM By Phil in CFUG,ColdFusion

I meant to do this last week but last-minute Christmas shopping, decorations, and feeling a little bit under the weather contributed to its delay. Anyways, here is a review of the December 18th meeting of the Philly CFUG meeting.

Spry/AJAX/ColdFusion
Keith Dodd presented on using various JavaScript technologies within ColdFusion applications, concentrating his presentation on the work he had done utilizing Spry, AJAX, and ColdFusion 8's AJAX functionality. Keith gave some background on Spry and then went into a few examples on how he utilized it on web sites he developed. One thing I noticed, which I think many developers don't do, is that he used Spry for small widgets within an overall application and didn't try to force his site to all Spry all the time. Some of the little tidbits from his Spry portion of the presentation were:

  • Uses "::" for node path combinations when retrieving data
  • Use "@" for obtaining values in attributes of a node. Both of these are from XPath notation.
  • Coded by hand originally to learn the framework and now sometimes uses the Dreamweaver CS3 plugin to quickly develop.
  • Examples for this and all of parts of his application are available here.

Keith then went through a few non-Spry AJAX examples and pointed out the tools available in Firefox's add-ons to aid in debugging, namely the Web Developer's View Generated Source and Firebug's Net tab.

Keith then finished up with a few examples of CF8, including a CFWINDOW for login that was modal. He noted that to utilize CFWINDOW, one must use CFFORM for any form within it. He also pointed to Ray's site as a good resource for CF8 AJAX examples. Overall, it was a good introduction into the world of AJAX and how one might use it in pieces of an application.

Unit Testing with cfcUnit
Chris Scott did a presentation on using cfcUnit for Unit Testing. cfcUnit is based on the JUnit framework. First, Chris walked through a basic calculator example where he created a simply calculator CFC that did addition, subtraction, multiplication, and division and wrote a test class for it. The test class extended the base TestClass CFC, a must for using the cfcUnit framework and the command assertEqualNumber() method. This was an easy example that showed how to use some of the basic "assert" methods to get test results, how to create a test CFC, and what is outputted when there is an error.

Next, Chris went into Test Driven Development (TDD), a part of the Agile programming methodology. Here are some bullet points from this part of the discussion.

  • Goal is to minimize risk by developing small, well tested apps or portions of apps
  • Each chunk requires design analysis, requirements documented fully, and TDD can be fully realized
  • Flow of app: Requirements, Design, Test Cases, and develop code only to pass the test cases.
  • TDD stresses Unit Tests prior to implementation meaning code is only written to satisfy unit tests.
  • Tests are grouped together to form test harnesses which allow for refactoring of logic with minimal risk.
  • The tests developed become contracts for CFCs written.
  • This approach allows for more cohesive units of work
  • The test harnesses can become part of the entire build process and help lower the risk during refactoring.
  • He uses a number of unit tests within the ColdSpring development cycle.

Chris then walked through a number of examples of how he uses cfcUnit within his ColdSpring build process. ColdSpring itself offers classes to make building and executing cfcUnit tests easier. He also showed a nice little test that executes a transaction and rolls it back. He also noted that this is a CFTRANSACTION that occurs so if there are CFTRANSACTION tags surround what is being tested then this will most likely fall because of the inability to nest CFTRANSACTION tags. This has been a problem creating unit tests for ORM frameworks like Transfer and Reactor in the manner Chris was showing.

The final thing Chris showed were how to use Ant to execute tests as part of a build process. His build.xml file would move items from his Eclipse workspace to his webroot. The interesting thing I found was that he didn't have the workspace in the webroot, something I do but I think I will reconsider now based off of this presentation. The build.xml also included cfcUnit definitions for creating and running various cfcUnit tests. Chris took it one step further and showed how all of this could be done withing Eclipse by setting up a builder for the project so that when a file within the project was saved the build.xml file executes, with the results displayed in the console window. It's essentially the same process Flex Builder uses to compile a Flex application. Maybe Chris will step through this in a blog post someday for the CF Community?

Overall it was a great meeting, lots of questions and discussion on various topics surround the items presented. Looking forward to the meeting in January which is part of the Adobe Flex/AIR tour.

Comments

Post Your Comments

Captcha

If you subscribe, any new posts to this thread will be sent to your email address.