Article

John Farrar on the COOP ColdFusion Framework

Page: 1 2

SP: Are there any great examples of COOP "in the wild"?

Well, we don't have any Amazons or Googles just yet...

SP: Sure. Well, can you give us look at some of the code?

No problem. Here's how we could build a simple segment of a COOP page.

OLD SCHOOL (Procedural code at its finest)  
<cfoputput>  
<select id="myFruit" name="myFruit">  
<cfloop list="apple,blue berry,cherry,mango,orange" index="iFruit">  
<option value="#iFruit#">#iFruit#</option>  
</cfloop>  
</select>  
</cfoutput>  
 
STAGE 1: Prototype  
<!--- Notes:  
We're passing in a list but coop can spot  
if the data is a list, array of structures or  
a query and knows how to handle that internally.  
--->  
<coop:selectlist id="myFruit"  
data="apple,blue berry,cherry,mango,orange">  
 
STAGE 2: Refactor  
(in the word of one developer, the markup page gets "elegant")  
<coop:selectList id="myFruit">  
 
(the co-processor page now adds this...)  
<cfscript>  
/* The init is the base for the page object modeling.  
* The myFruit is the ID of the object we are programming  
* before creating it. A.K.A. preDOM.  
*/  
_init.myFruit.data = "apple,blue berry,cherry,mango,orange";  
</cfscript>  
 
STAGE 3: Enhance  
<cfscript>  
/* Enhancing the code to real data and control  
* by setting attributes in code rather than  
* inside the markup.  
*/  
_init.myFruit.data = getFruit();  
_init.myFruit.valueField = "fruit_ID"; // id field in recordset  
_init.myFruit.displayField = "fruit"; // fruit name in recordset  
</cfscript>

There is much, much more that has been built in, and simplified in, COOP. Programming sites with this technology and lets designers do their job without the if...then...else, loop, and all that stuff we developers enjoy. It lets us control the page without touching the design, so we don't get blamed quite so often for messing up the look and feel! And if you're working on a site alone, it lets you concentrate on one thing at a time, which is great.

SP: What about licensing, community, support, and documentation?

Our licensing model is listed on at http://coop.riaforge.org/ -- basically as COOP is our creation, and there's no liability for its use, others are welcome to use it for any project. If users have any questions, they can just ask, and we'll let them know how it works in your scenario. For community support, we have a Google group set up, and initial documentation is available from our site.

SP: What's coming up in the future for COOP?

Firstly, we're working on version 2.0, but we're going to do a 1.5 release, paving the way. The changes include simple things like a full Unit Test on the back end to test all of the COOP CFCs and tags. We've re-factored our code base so that it's more portable, and isn't locked to the root of the site. We now handle structure of arrays, and it's possible to use XML as a data source. On the documentation front, we're working on YouTube videos for each tag and aspect of the platform.

In the future, we'll implement ICE libraries (TinyMCE, jQuery Grid, Flot, YUI Editor, and much more to follow). These are COOP-style libraries ("ColdFusionified", if you like), collections that have been re-factored to work more easily and integrate more effectively through the power of ColdFusion.

SP: Where can people find more information about COOP?

The base site for COOP is http://coop.riaforge.org and the wiki there, at http://coop.riaforge.org/wiki/, offers a lot of information.

Our initial docs can be found on our site -- they should get most people started.

Again, check out the upcoming YouTube videos to get more detail on how to use all the great features of COOP. If you'd like to get in on the 1.5 beta, go to our forum, which is located at RIAForge. There's also an online presentation on Charlie's UGTV from the time when the product went to version 1.0.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: