Blog Projects
Escape Keys
A ColdFusion and Web Development Blog by Tom de Manincor
 

The guys here at CFUG NL are putting together a battle of the frameworks.

Bringing in presenters for each of the major frameworks: Coldbox, Mach-ii, Model Glue, and Fusebox.

I have been asked to represent Coldbox.

Each presenter will give a walk-through on how to build a basic application. We don't have too much time, so we will squeeze in as much info as we can about the frameworks, as well.

To help benchmark and to give developers a better understanding of what each framework offers, we will all be building the same app.

It will be held at the Adobe Office at the Amsterdam Arena and will start at 14:00 hours.

A number of requests and inquiries have come in about TransferSync and multiple application instances running on the same server.

Thanks goes to Dylan Miyake, who was kind enough to provide the solution.

I have updated the project TransferSync @ RIAforge, you can get the latest code there.

Team Coldbox is preparing to offer Certified Coldbox training courses here in the Netherlands.

I am hoping to offer our first course this winter in Amsterdam.

So if you have any interest or suggestions, please send them this way.

Luis and Team Coldbox have been busy as usual creating top-notch code for us all to use.

The upcoming 3.0 version of Coldbox is packed with improvements, new features, and all kinds of tools to make a CF developers life easier.

It's in alpha now and available from the Coldbox download page.

You'll also find LogBox, a logging framework, and MockBox, an object stubbing framework, are ready for the public to get their hands on. BlenderBox, a new IOC framework is around the corner, as well. Whether Luis likes it or not, I have deemed the new collection the 'Box Suite', for obvious reasons.

CB-101 ColdBox Training in Ontario - Day 1

I'm no novice when it comes to Coldbox, but I've also never had the opportunity to sit and go thru the system with the author himself. That alone had me looking forward to the seminar.

The course kicked off with a nice breakfast and a goody bag loaded with training materials, a t-shirt, cheat sheets, candy and snacks, not to mention the bag itself is pretty nice.

The training manual has to be around 300+ pages, and that doesn't include the exercises. That's a separate booklet 100+ pages thick. Both are as rich in content as they are in size.

The lecture began with an intro to Design Patterns, Object Oriented methodology, and the vocabulary needed to comprehend the framework's architecture. He also went over some Best Practices not specific to Coldbox. A good lesson for those migrating from spaghetti or even well structured procedural code.

The highlight for me came when he mentioned a few things to be aware of when using ColdFusion. Years of CF and I guess a few things had slipped by me.

Did you know:

1. Variables of type string, array, number, and date all pass in and out of components by value. But structures, queries, and all other 'complex' objects including CFCs get passed by reference. May seem obvious to some, but to me, the ARRAY type seemed liked it should of been grouped with the complex types and passed by reference. Apparently, its a CF thing. Don't know how I feel about that, your thoughts?

2. ColdFusion creates java inner classes for each method in a CFC. So on top of the classes it uses to build CFC objects, it also has to instantiate these inner classes for each method. So consider the overhead of bloating objects with simple getter and setters, is it worth it?

Definitely, got me thinking...

From there we jumped into framework itself. Luis went over how to get it installed, configured, and how to tweak your IDE (eclipse and dw snippets and dictionaries).

The focus with Coldbox has always been the developer. If you don't know, there are lots of features that you wont find in other frameworks that make coding easier, and more fun. Luis touched on the development tools such as, the dashboard, debugger, cache monitor, and even the SideBar, to name a few.

Things started getting pretty advanced when we got into the Coldbox architecture and hierarchy. A great way to really understand the power and the functionality you have available from within the framework. I don't want to spoil it for those attending the seminar at CFUnited, so I wont go in to much more detail. I will say there are lots of details and knowledge to be absorbed, even for a veteran like myself.

Looking forward to Day 2's lesson. We still have half of the training manual to go.

Major updates have been made to TransferSync.

This version has a critical fix for those dealing with related objects. Somehow, the afterCreate event was overlooked during the early conception of this approach for managing the Transfer cache using a JMS gateway.

Once, that was implemented, it was apparent that better synchronization for parent objects was needed. For instance, when a new child is created, or existing child has a parent switched during an update.

I have temporarily removed the sample app. Once I get a chance to clean it up, I'll bring it back. If you need samples, contact me.

Other then that, there have been some great improvements. Take a look at the change log, or grab the latest version here: TransferSync @ RIAForge

0.5 -CHANGE LOG- 3/9/2009
- enhancement - added observer toggle no longer dependent on lazy init
- enhancement - added debug toggle
- enhancement - added class filtering
- enhancement - added caching for parents
- enhancement - added getMemento and getVersion
- enhancement - more robust logging
- enhancement - coldbox versions supports pre-cf8
- fix - added support for after create events
- fix - added support for notifying parent classes

SalesForceCFC Example Code

I apologize. I left out the test page and sample code from the latest release.

I've updated the project to include the Application.cfc, which is required for testing the security token persistence using the session scope. Along with the testForm.cfm, which has all the example code, and demo.

SalesForceCFC @ RIAforge

SalesForceCFC gets a BIG update!

This is a much improved release. It brings the object's architecture up to date, improves performance, and offers a few new features.

0.6 -CHANGE LOG- 2/22/2009 - enhancement - auto login
- enhancement - upgraded constructor
- enhancement - more getters and setters
- enhancement - last login added to instance
- enhancement - added utility calls getUserInfo and getServerTimeStamp
- enhancement - upgraded soap handling to minimize code
- enhancement - session handling added to test form to demo persistance
- deprecated - username and password parameters have been removed from login
- deprecated - objDataStruct on return from describeObject()
- fix - validate method getServerURL missing parenthesis
- fix - test form updated to avoid crossover and better cleanup

Download a copy at SalesForceCFC on RIAForge

It was brought to my attention, that you can not return more then 2000 records at a time using the query() method in the SalesForce API.

This is done to throttle performance and overhead when using the API. SF does make the data available, but it requires a few more steps.

I've integrated these steps and added the queryMore() method to salesForceCFC.

Along the way, queryObject() was updated to now accept a 'batchSize' argument. You can now specify the maximum number of records to return when doing a query. Similar to doing a SELECT TOP in MS SQL, or a LIMIT in regular SQL.

<cfset qAccount = oSF.queryObject(queryString = "SELECT Id, Name, createdDate FROM Account ORDER BY NAME", batchsize = '300') />

If there are more records then the batchSize you send in, then you will see a QUERYLOCATOR key in the return struct. It's a reference to your query on the SF server. It will remain available until there is 15 minutes of inactivity on it.

<cfset qAccountMore = oSF.queryMore(queryLocator = qAccount.queryLocator, startRow = qAccount.batchSize + 1, batchsize = 300) />

The 'queryLocator' gets passed in to the queryMore() method instead of passing in the queryString like you do in queryObject(). The option to 'includeRelatedObject' is still available with queryMore(), as is 'batchSize', and 'startRow'. One thing to note, is that SF will always return at least 200 records. So your batchSize should never be less then that.

With the new updates to this release, you now have the power to paginate any size query using the SalesForce API.

Download a copy at SalesForceCFC on RIAForge

Here is a great post by Brian Ghidinelli on how to integrate TransferSync in a ModelGlue and Coldspring system.

Check it out: Synchronizing Transfer ORM in a Model-Glue/Coldspring cluster with TransferSync

More Entries