Rob Gonda's Blog

AjaxCFC for jQuery JSON Update

Jeff Borisch point out that the cfjson v1.6b that I was using for the jQuery AjaxCFC was buggy. I updated it to v1.7 in the SVN and the project download file... I strongly suggest you get this update.

Cheers.

Cairngorm 101 presentation and files

I presented a session on Cairngorm last week at CF.Objective() and explained all its elements, design patterns, event flow, levels of abstraction, and walked-through steps on a simple example.

You can find my slides and examples -- MVC1.001, 002, and 003 -- and each adds a little more functionality. MVC1.001 just displays a form, 002 adds a click event, fire an event, traps is in the controller, executes a command, updates the model, and 003 also uses a business delegate and a service locator. To run the files simply extract in a folder, open flex builder, import a project, and point to the MVCX folder. I did not include the Cairngorm source files, so depending on your preference, either copy them into your project, or add the SWC to your classpath library. You can download the latest version from labs. Just in case, right click the project, click properties, Flex Build Path, Library Path, click Add SWC, and point to the cairngorm.swv binary that you downloaded from labs.

Here's an overview of the differences in the examples so your can follow along:

MVC1.001
* Cairngorm MVC with views only
* No events, commands, model, VO
* Main file loads service, controller, and viewlet

General flow:
* Main shell loads business, control, and view
* View displays login box


MVC1.002
* MVC1.001 plus
* Cairngorm MVC with model, view, controller
* No business delegate or service locator
* Main file loads service, controller, and layout view
* Added LoginCommand, and LoginEvent
* Control registers event
* Added Login model in model locator
* Model implements state
* View contains view stack binded to state
* Command immediately approves login attempt and update model

General flow:
* Main shell loads business, control, and view
* View displays layout with view stack
* View stack is bound to the model and displays login box by default
* User clicks login button and triggers loginUser()
* Function creates a LoginVO to hold the login data
* Function creates a LoginEvent and passes the LoginVO
* Function dispatches the event
* Controller traps the event and executes the LoginCommand
* Command updates the login model and workflow state in model
* Viewstack is bound to workflow stats and update view


MVC1.003
* MVC1.002 plus
* Cairngorm MVC with model, view, controller, business delegate, and service locator
* Added LoginDelegate
* Services.mxml contains RPC, but it's commented out for demo purposes

General flow:
* Main shell loads business, control, and view
* View displays layout with view stack
* View stack is bound to the model and displays login box by default
* User clicks login button and triggers loginUser()
* Function creates a LoginVO to hold the login data
* Function creates a LoginEvent and passes the LoginVO
* Function dispatches the event
* Controller traps the event and execute the LoginCommand
* Command initializes the LoginDeletate to talk to the server
* LoginDelegate gets the loginService from the service locator (commented for demo purposes)
* LoginCommand invokes thes login function in the LoginDelegate
* LoginDelegate invokes the login function in the loginService (commented for demo purposes)
* LoginDeletate calls the loginResult which randomly logs the user in (only for demo purposes)
* Service call returns and calls the onResult function in the command
* Command updates the login model and workflow state in model
* Viewstack is bound to workflow stats and update view

I'll explain all this and much, much, much more in my 8h Flex Intensive for ColdFusion Developers at CFUnited.

VMWare 6 release

VMWare is the best virtualization software for Windows and they just released the 6th generation. This is what I use to test my code in different environments, different databases, os's, etc: CFMX7, CFMX8, Windows, Linux, Oracle 9, Oracle 10, PostgreSQL, MySQL, SQL Server 2000, SQL Server 2005 ... it's trully amazing. You can now clone existing systems and virtualize them; this was previously available only with VMWare Server. I also ran Ubuntu Workstation, OSX, just to test them. You can develop locally and map a folder in your VM to your local machine, thus, all your dev environments will read out of the same codebase. Among the new features you can find:

  • Windows Vista support: Users can deploy Windows Vista as a guest or host operating system, facilitating re-hosting of legacy systems, enabling upgrade and migration projects with minimal end-user disruption and simplifying Windows Vista evaluations.
  • Multiple monitor display: Users can configure one virtual machine to span multiple monitors or multiple virtual machines to each display on separate monitors with this industry-first capability, enhancing desktop productivity.
  • USB 2.0 support: Users can take advantage of high-performance peripherals such as Apple iPods and fast storage devices.
  • ACE authoring capabilities: As a companion to VMware Workstation 6, VMware now offers a VMware ACE Option Pack, which enables VMware Workstation 6 users to create secure, centrally manageable virtual machines. Mobility is one of the primary benefits of this Option Pack, as it allows users to securely transport virtual machines on portable media devices such as USB memory sticks.
  • Integrated Physical-to-Virtual (P2V) functionality: Users can create a virtual machine in minutes by “cloning” an existing physical computer.
  • Integrated virtual debugger: Users can deploy, run and debug programs inside a virtual machine directly from their preferred integrated development environments (IDEs), accelerating debugging with this industry-first integration with Eclipse and Microsoft Visual Studio.
  • Background virtual machine execution: Users can run virtual machines in the background without the VMware Workstation user interface for an uncluttered user experience.
  • Automation APIs: Users can write scripts and programs that automate and help quicken virtual machine testing with support for VIX API 2.0.

In addition, VMware Workstation 6 advances the state of the art in virtualization technology with groundbreaking new capabilities including:

  • Continuous virtual machine record and replay (experimental): Users can record the execution of a virtual machine, including all inputs, outputs and decisions made along the way. On demand, the user can go “back in time” to the start of the recording and replay execution, guaranteeing that the virtual machine will perform exactly the same operations every time and ensuring bugs can be reproduced and resolved.
  • Virtual Machine Interface (VMI) support (experimental): VMware Workstation 6 is the first virtualization platform to allow execution of paravirtualized guest operating systems that implement the VMI interface.

Win at Nintento Wii from CFUnited

This is actually really cool. CFUnited is promoting the open source movement for ColdFusion by giving away a Wii in exchange of hosting/writing a CF open source project. More info here.

Developer Circuit: specialized jobs

Developer Circuit is growing and looking good. They provide a nice widget, in two different sizes, that are displayed in influential sites, such as top ColdFusion and Flex community blogs. It is currently syndicated by 52 sites and displayed over 8000 times today. The widgets were developed in Flex 2 (check them out in my jobs section). To post a job click here, and to find out more about the widgets, check out their widgets section.

Yahoo Web Messenger Built with Flex 2


Flex is so cool! Check out the full story.

Model-Glue:Flex

After playing/working with Flex and Cairngorm for a few months, Joe Rinehart (author for Model-Glue) chose to write a port for Flex. Cairngorm was built by the Adobe Consulting Group, and applies a number of design patterns and best practices that make it very flexible, scalable, robust, and manageable, however, because of its layers of abstraction it does require some repetitive code to be written. MG:F's goal is to provide a similar level of abstraction, but making the framework automate some of the tedious processes.

I have not looked at the code myself yet --though I expect to do so very soon--, but you can start checking the posts, such as the Service Autoproxies.... stay tuned.

This blog is running version 5.9.003. Contact Blog Owner