ColdBox Platform 3.0.0 : Developing Sustainable ColdFusion Applications - Luis Majano (Ortus Solutions)
As a firm believer in roll your won code I’ve always viewed large frameworks with some suspicion. Especially when Mike in his caching session pointed out that a framework with 1000’s of CFCs before you even start writing your own code is chewing into much needed heap space.
I’ve played with FW/1 and liked the lightweight, simple approach to development and had looked at ColdBox in the past but was turned off by the XML declarations** and the general scale of the framework.
ColdBox 3 looks like that is going to change, Luis is an amazing presenter and clearly a skilled and experienced developer and the ColdBox team have pulled out all the stops to make v3 look absolutely amazing.
First off – no more XML, it’s a pure CFC based framework. This is a massive attraction for me as I had a real problem with the “configuration” aspect of ColdBox 2.x.
Secondly they’ve improved the SES URLs and routing engine to allow for built in RegEx parsing of your URLs. Nice to have all of your config in one place as it prevent having to worry about eeevil re write engines. Of course it does mean being reliant on the CF RegEx engine but then hey – that’s not so bad.
The new Route Handler allows you to map HTTP verbs to methods in your controllers – perfect for RESTful development.
They’ve also expanded the built in debug tools to include a live profilers, monitor and cache inspector – v cool stuff!
Not sure if I’ve got this right but the new ColdBox proxy allows you to use ColdBox apps as the backend for Flex / Flash Remoting / AJAX without invoking the overhead of the GUI stuff.
3.0 also bring modules to the party allowing you to separate sub sections of larger apps into standalone apps which can then be pulled together as part of a whole. This functionality comes complete with an API to programmatically manage the modules and snap them in and out.
LogBox remains much the same but with improved appenders and better performance.
MockBox is a full stub / mocking suite to link into your unit tests via MX Unit without having to wire up the whole app. Not something I’ve really used much of but am interested to see what it can do!
CacheBox now supports multi engines and has exposed the full event model for programmatic cache inspection and control. They’ve also written in Event View caching for caching responses from your View Code
WireBox gives you annotation based dependency injection for any type of object, CF, Java or otherwise! It also provides a full DI event model and a simple, clean domain specific language for managing your injections.
WireBox adds some support for AOP to your ColdBox apps allowing integration of logging, transactions, etc without having to modify your code. This is again fully programmatic and can be referenced by name or by annotations.
Luis is a fantastic speaker with an obvious passion for the ColdBox platform and good software development practices across the board. His enthusiasm was certainly infectious and I got the feeling that a lot of the developers in the room were sold on ColdBox by the time he’d finished this exhausting whistle stop tour of 3.0
Score out of 10? 10.2 – again I have to wait to play with it and I still struggle with the idea of migrating our legacy apps to a framework this complex and powerful but I’ll definitely be giving it a go for the next big project!
**One exception – I’ve been using LogBox standalone for a while now and love it!
AJAX is the answer to everything and we never need to worry again and life is full of unicorns! Ray Camden (FirstComp)
Ray’s second session was run as a “round the room” Q&A between Ray and the assembled developers
A very cool way to run a session, it actually meant that the assembled masses benefited from Ray’s considerable experience in building Ajax applications which being able to pose their won questions for peer feedback. Often the Q&A periods at the end of sessions gave rise to some of the more advanced and insightful snippets of the two days so having an entire 45 minutes given over to this kind of content was brilliant.
Ray kept the session moving at a pace that meant most people got their questions asked and answered without dwelling for too long on any given topic. Some of the memorable points raised included a developer’s need to consider scalability when using AJAX techniques (especially in master detail setups) and the savings that can made by using JSON in place of the more traditional XML.
My personal fave CF feature, CFAjaxProxy, was the subject of a short debate (admittedly started by my question) resulting in the advice that developers definitely consider making use of this powerful tag but consider building another layer of “proxy” objects to handle the interface.
Score out of 10? 10 – an awesome change of style and total audience participation made for a fantastic session.
SQL to HQL John Whish (Crisp eBuisness)
Part of the reason I’d had to turn down attendance at SOTR09 was the understandable focus on the new ORM features provided by CF9. My bosses had decided the CF 9 was just too much of a change and that the benefits would be limited.
Since then, we’ve put our first CF9 box into production and have a dedicated CF9 dev server so I was really excited to play catch up on some of the ORM and Hibernate Goodies available in this year’s conference.
I should quantify the below by saying that, prior to SOTR2010, I had little opportunity to play with the ORM functionality and therefore went into this session with little more than a broad overview of understanding about how Hibernate works.
John’s session was to be my first conference look at ORM and he certainly didn’t disappoint. After an initial introduction to the Hibernate underpinnings of CF9’s ORM capabilities, John moved quickly into a detailed look at how developers can use Hibernate Query Language to return results based on customised queries of the properties of your CFCs.
Scanning my notes (of which there are about 4 pages!) the highlights that jump out at me are:
- HQL returns arrays of objects and not a query object.
- There are a host of HQL specific functions in CF9
- You don’t have to use SELECT foo in HQL queries … FROM bah is sufficient
- HQL is case sensitive when referencing entity names
- EntityToQuery() transforms the array of objects into a Query object – presumably for legacy support
- WHERE tests are run against the properties of the stored objects / entities
- HQL provides a valid alternative to running entity load in certain circumstances.
- SELECT foo AS bah can be used to alias data
- You can also select specific properties from your objects but this returns the eeevil Array of Arrays
- ORDER BY and GROUP BY are both supported
- Some SQL functions are supports
- It is possible to prepare queries by passing in named parameters to the query by way of a struct or array of parameters.
- Filters can be used to define relationships between your entities.
In terms of style, John managed to blast through 50 minutes of fairly dense technical work in short order. His style was wonderfully British, dry yet entertaining and always very well informed and I left the session champing at the bit to get started on my first applied piece of HQL development.
Score out of 10? 10.9 – it was 9.9 for a well rounded, well delivered presentation on a subject that’s pretty hard to sex up … John earns a bonus point for his brave admission to being a conference virgin at the start of session!
Cloudy with a chance of Caching and Clustering Mark Drew (Railo)
More caching and clouds! Gotta love it. In my previous life, building highly available platforms was a major part of day to day work so I was intrigued to see what the Railo team had pulled out of the bag to make this easier. Also, as much as I hate to jump on the buzz word bandwagon, I do find the cloud to be a very exciting development in computing across the board and seeing the ole web cumulus get a little CF love certainly appealed.
Even before considering the content I have to say that Mark is a brilliant presenter. Frankly I get the feeling the guy could talk about tea bags for an hour and still be engaging.
He opened with a overview of the session and then introduced us to Stuff In My Mind dot com (or possibly things in my head dot com or maybe thoughts in my brain dot com) an example application that was about to suffer from scalability issues due to an unforeseen popularity increase… which is nothing like anything that ever happens in the real world.
Mark ran us through the caching tools that could be applied in Railo (EHCache) before demonstrating the new distributed cache server support that Gert had touched on the day before.
This new feature allows for shared caches as well as shared scopes thus rending one of the biggest problems in clustering pretty much moot at a stroke.
Continuing the Railo team’s theme of blowing my mind, Mark went on to demo the Admin Sync feature which allowed him to wire up multiple instances of Railo and have then share DSN settings and other admin configuration via a circular replication setup.
This is pretty huge considering it would allow you to scale your app horizontally with next to no effort.
Mark proceeded to explain the concepts by which vertical and horizontal scaling could be achieved by separating out different aspects of the app onto difference instances (or clusters of instances) of servers.
Having dropped this little lot on the room and finding himself with 15 minutes to spare he then went on to demo the new S3 mapping support that is built into the latest Railo RC allowing all file operations to take place on an S3 bucket as if it were a local file system.
Mark rounded off with a quick bit on the Railo EC2 AMI.
Again I was amazed on two fronts; one that Railo is already doing things that Adobe had announced as “coming up” in ColdFusion 9.0.1 and two that they’re so dammed cool about it. Not a hint of smugness just a developers satisfaction in making their tools the best they can to work with.
Score out of 10? 9.4 – the actual content of the session wasn’t exactly new to me but it was well delivered and certainly leaves a lot of food for thought when thinking about scale out CF applications.
Productive Work Environment / Practices – Peter Bell (Railo)
As an owner of Getting Things Done and as someone who’s been using the Pomodoro technique for the past 6 months (with varying degrees of success) I sat in on Peter’s session expecting more of the same. I was pleasantly surprised.
I’m not going to bother typing up the Pomodoro notes as the concept it thoroughly detailed online and a quick Google search will serve you infinitely better than my concise ramblings. Instead I’ll focus on the areas that were new (to me at least) and may be over looked by some developers who would consider themselves experts in time management:
- The use of launchers (Quicksilver, Launchy, etc.) and shortcut keys was covered briefly. It’s pretty self explanatory but the idea of having to leave your keyboard as little as possible is certainly something I can relate to – especially when you’re in the zone!
- Flow (as explained in Mihaly Csikszentmihalyi’s book of the same name) was explained as were the conditions which need to be met before it can be achieved (i.e. the concept of clear goals, control over your work, direct feedback which developers get in spades with every exception report, a balance of ability and difficulty or challenge and the requirement that the activity in question be rewarding)
- A very interesting section on Waste Management / Lean Development which identified the concept of Value Stream Mapping to improve processes and give you a path for future improvement by trimming wasted or invaluable actions.
- A section on testing and the tools that can be used to perform these tests including Selenium IDE for Firefox to regression test from a client’s perspective (this is brilliant btw and is now in regular use as part of our test suite) and the more traditional MXUnit for unit and integration tests.
- ANT and other Automation tools for pre deployment actions from within the IDE (ANT can be used to wire other test frameworks together
- The idea behind building a quote or speccing system that would automate the normally time consuming and complex task of quoting for work
- Time tracking as a developer feedback tool rather than the hated business intelligence objective that’s normally associated with it
- Retrospectives (apparently taken from the SCRUM methodology) which allow developers to review regularly, look at actual metrics for their work and productivity, refine their goals and perform root cause analysis)
All in all Mark gave a very good overview of some very powerful techniques to track and improve performance both as an individual developer and one working as part of a team.
Score out of 10? 9.8 I thought I’d know a lot of this stuff and was glad to be proved wrong!
Advanced ORM – Terry Ryan (Adobe)
The last session of the day was on Advanced ORM (one hellava subject to leave till last!) and it was very fast, very in depth and very very useful.
Leading on almost perfectly from Johns HQL presentation Terry ran through the different types of mapping available to ORM developers and when they should be used.
He gave examples of specific field types that can be applied (e.g. Version or Timestamp) to address pretty common row versioning requirements.
He ran over the different types of fetching that can be applied to your ORM design and touched on the use of Batching to reduce the number of queries needed by increasing the complexity of fewer queries.
There was a lot of detail in using the new caching options to cache HQL queries, objects and collections.
He touched on the wiring available for ORM events (i.e. Pre and Post update methods) and how they can be used to sanitise and manipulate data before it is stored.
And a whole lot more!
To be honest, I have 6 pages of notes from this session and I’m still working through what they all mean and if I’d ever need to use them. If you really are desperate to know exactly what was covered in this session then feel free to ask Terry directly as I’m sure he’ll do a much better job of explaining it that I will.
Score out of 10? 8.9 – Great presentation but so much information delivered so fast and without access to the slides or code examples to work with as he went it was difficult to do more than parrot it onto paper to try and work out after the event… but again I’m very new to ORM!