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.

TransferSync v0.5 has CRITICAL fix and more.

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 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

SalesForceCFC v0.5 now supports pagination with queryMore.

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.

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.

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