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.
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.
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 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:
In addition, VMware Workstation 6 advances the state of the art in virtualization technology with groundbreaking new capabilities including:
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 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.
Flex is so cool! Check out the full story.
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.