For ease of reference I just wanted to post a quick note highlighting Bob Silverberg's excellent series on using Transfer ORM and OO architecture:
- How I Use Transfer - Part I - Introduction
- How I Use Transfer - Part II - Model Architecture
- How I Use Transfer - Part III - Abstract Objects
- How I Use Transfer - Part IV - My Abstract Service Object
- How I Use Transfer - Part V - A Concrete Service Object
- How I Use Transfer - Part V.1 - A Comment and Response
There's a lot of good information here although it may be a bit overwhelming on first read so be prepared to keep coming back to these posts!
I'm 46 years young!
Probably the best Guinness advert ever made! Raise a glass!
First off, let me say that the reason I think this causes confusion for a lot of CFers is that they don't have a Computer Science background so they've not had the "Memory and Pointers 101" course that makes this stuff a lot clearer. Hopefully, this blog post will help fill in some of the gaps.
Some basics. When you assign something to a variable in CFML, you are really doing two things: you are creating a label (the variable name) and you are allocating some memory to associate the label with the data. In particular, with structs, the struct itself exists in a block of memory (well, lots of connected blocks of memory) and then the variable "points to" the struct data.
Let's start with the simplest example (these examples require ColdFusion 8.0.1):
I've owned my house in Castro Valley for seven years (next month) and I just took advantage of the great interest rates and the new conforming loan limits to lock in a 30 year 5.5% mortgage, paying off my previous two mortgages (a $300k 30 year and a $70k 15 year balloon payment). This is the third refinance in six years and the first to lock in above what I paid for the place (paid $370k, financed $409k, value $600-700k depending on who you ask, although Indymac Bank thinks it's only worth $515k... go figure!).
So, I'm happy with my new mortgage. I am not happy with the stream of insurance spam I've received in the last week. Several offers every single day (six today, OMG!). Mortgage protection, health insurance, home insurance. Jeez, leave me alone! I have all that shit already!
I know that a mortgage is a matter of public record but this is ridiculous! The worst thing about these slimy insurance and loan spam offers is that they are all - and I mean ALL - couched in terms of something you should complete and return for your lender. Sure, they all have small print saying they're not associated with the lender but with some of them you really have to read it two or three times to convince yourself you're not reading something important from your own lender.
It's disgusting. Especially given the sub-prime lending disaster we're going through right now. Clearly these companies have no ethics at all.
David Harris has a brief post about the joys of jQuery where he comments on what, to him, was an unexpected feature that allowed binding of variables, i.e., JavaScript (and ActionScript) support closures. I find it interesting that he thinks this binding "somehow feels wrong" and I've seen the same reaction from a number of people when first confronted with closures.
This binding is what gives closures their power and why they are more than just "anonymous functions". They carry with them the context in which they were created.
It's also an interesting contrast with ColdFusion where variable binding is done at the last minute at runtime and thus you can take a UDF function that references variables.foo (which might be a page scope variable) and add that function to a CFC instance and now variables.foo will refer to foo in the variables scope of the CFC itself.
I think that's why my Closures for CFMX library has proved so puzzling for a lot of folks :)
- Reprint: Consuming Web Service complex types in ColdFusion
- Using WSDL2Java to figure out CFML arguments to a Web Service
- Special Axis types and ColdFusion
So, even tho' Tom is off doing Blaze DS and LCDS these days, he's still producing rocking blog posts about ColdFusion - go Tom!
The real gem about this post is the extended commentary by Brian Kotek and Ben's responses. Brian posts some really solid guidelines on designing well-structured object-oriented systems and the dialog between the parties is very enlightening.
I just renewed my annual subscription to Fusion Authority Quarterly Update but because I'm a (fairly) regular author and I'm also on the "staff" (as the Curmudgeon!) I get multiple copies of each issue anyway for promotion purposes. I pay my subscription to support the journal anyway but after talking to Judith at Fusion Authority, she thought it might be fun to run a little contest for someone to benefit from the subscription I pay for but essentially don't use! So Fusion Authority in conjunction with An Architect's View is offering a year's free subscription to FAQU to the first person to contact me with the answer to this simple question:
How many full articles have I written for FAQU so far and what were they called?
In this session, you'll learn from John Resig, the creator of the jQuery library, how to build a desktop application with Adobe AIR and jQuery. jQuery is a fast, concise JavaScript library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. Although jQuery is typically used inside a web browser, it's now possible to use jQuery to build rich desktop applications.Should be a great (and extremely popular) talk!
34 sessions cover AIR, 54 sessions cover Flex.
Compare that to 13 sessions on Dreamweaver and 14 on the flagship Photoshop product and I think we have no reason to complain (but, of course, some folks will).
My "Event-Driven Programming in ColdFusion" talk has been selected for MAX which I'm pleased about and I will reveal that it will be substantially different to the version shown at Scotch on the Rocks and CFUNITED...
Next up was Rupesh Kumar "All about cfthread" which focused more on how hard it can be to write safe multithreaded code than "cool" examples so it was very educational and it means I need to go back and rework part of Edmund to cover some edge cases I'd missed. I'll probably blog more on this in due course since several folks were pretty confused about why Rupesh's examples "didn't work".
After lunch I went to John Farrar's talk about jQuery which showed how easy it was to use and how powerful the selector syntax can be. It was a good intro talk and after several of those for jQuery, I think I'll be ready for more advanced jQuery stuff at the next conference.
Finally it was Joe Rinehart's "From ColdFusion to Flex: Model-View-Controller" which looked at apply MVC principles to structure Flex applications with some simple "no framework" suggestions for organizing code. About the right level for me with my lack of Flex skills at the moment.
And then that was it, CFUNITED was over for another year!
I chatted to John Zhu (ChinaOpen organizer) for an hour then headed back to my room.
I'll write a summary of CFUNITED shortly but, briefly, I enjoyed the networking, I wasn't thrilled with the convention center location, I went to just eight sessions - but there were only two others I wanted to see (I don't really come for the content tho'). More later.
I had nothing to do with this project but given my recent interest in jQuery, I felt it was worth blogging about. I think it really shows the power and simplicity of jQuery.
The one session of the day I intended was Elliott Sprehn's "Internals of the Adobe CF Server" which was absolutely incredible! Elliott clearly has far too much time on his hands and has done some amazing detective work to learn about many of the core classes inside the ColdFusion runtime and how to use them.
He explained in some depth how several CFML code constructs actually work at the Java layer and how to do some very cool things with them. One example was passing your own "local scope" into a function call and then using it to examine what local (var scope) variables were set inside the function after the call. He also showed how to invoke most CF tags from CFScript so that, for example, you could throw a custom exception (by creating an instance of the ThrowTag, setting some properties and then calling doStartTag() on it).
Make sure you download his slides and code once they become available.
For me, this was the most interesting talk of the conference so far.
So, again, a day short on sessions but ultimately rich in networking and developer discussions. Next, dinner, drinks and maybe an interview for the CFConversations podcast.
I already blogged the Adobe keynote at Scotch on the Rocks but wanted to cover some of the sessions and the overall feel of the conference.
As I said before, it had a nice, relaxed feel to it and Andy Allan, Big Mad Kev and Stephen Moretti did a great job creating a conference that felt like a bunch of developers simply sharing their experiences and their wisdom. It was a really enjoyable three days with some fascinating sessions in an incredible location.
Neil Webb "Cairngorm for Beginners". I like Neil's analogies and presentation style. He was very frank about some of the things people don't like about Cairngorm but showed how code is organized and did a good job of making it approachable.
Nicholas Lierman "Web Analytics for Developers". This was a hard hitting presentation (most of what you think you know about analytics is wrong) with a lot of good, real-world advice and some real insight into using tools properly to filter and segment and analyze data to identify behavior.
Neil Middleton "jQuery in a Nutshell". An excellent introduction to the power of jQuery. I'm only just starting to get into jQuery so I learned quite a few things from this session.
Borre Wessel "Modularizing Flex applications". This was mostly over my head because I'm not doing much Flex but it was interesting to see how much work has been done in this area.
Adam Lehman - ColdFusion 8 and PDF (I can't remember the exact title). A good run through of the PDF capabilities in CF8 including the DDX stuff which gives you a lot of control.
Toby Tremayne "Becoming an Enterprise Developer". A highly entertaining and insightful talk about how to improve your skills and the key things that distinguish an "enterprise" class developer. Toby is also quite the magician and used several impressive tricks to illustrate some of his points (including nearly setting Adam Lehman on fire - who was sitting just a little too close to one of Toby's tricks!).
I covered the Railo keynote (albeit briefly) and will talk more about this in due course.
Kai Konig - internationalization. Real world experience on what it takes to create global applications and the various pitfalls you can run into. He covered techniques and tools but made it clear this was not an easy task - it requires effort to do it properly.
Neil Middleton - Testing. Neil covered the basics of unit testing with MXUnit, UI testing with Selenium and touched on continuous integration with CruiseControl.
Adobe BOF about Centaur. This was much more productive and calm than the session at cf.Objective(). A lot of good ideas came out of the audience (it even inspired me to suggest some new features that I hadn't thought of before).
Charlie Arehart / David Stockton - Keeping servers healthy. As always, a good talk from Charlie with lots of hints and tips as well as a demo by David of the forthcoming Fusion Analytics AIR application that analyzes log files and ties events together across multiple log files and server monitoring output. A very impressive tool for diagnosing the cause of bad behavior on your servers!
Peter Bell "RAD OO". A pragmatic and interesting look at the slightly different way Peter does object-oriented development when he's building out dozens of projects in very short timelines. He uses a mixture of code generation, metadata, generic reusable base classes and other techniques to achieve very high levels of productivity. It validated some of the techniques I've been considered as well as providing food for thought on some new things I might try.
Somewhere in between all of that were my two sessions (event-driven programming and getting dynamic) which were both somewhat experimental and left-field - and were mostly met with bewildered looks and a handful of puzzled questions. Some people said they enjoyed the talks and took useful ideas away so I'll consider them a qualified success.
It looks like Scotch will be back in 2009. Maybe even in the same fantastic location. I definitely want to attend next year - it was a wonderful shared experience and it was great to meet new people that don't get out to the US conferences!
The "breakfast" was a few croissants and some fruit and juices and a thinly veiled pitch from TeraTech for their services. Luckily only a handful of managers actually wasted their time attending.
Next was TeraTech's opening "keynote". It's always the most painful thirty minutes of CFUNITED. Michael Smith is a nice guy but he really doesn't understand what a keynote is meant to be about. At least he didn't mention FLiP for a whole 22 minutes this year (last year seemed to be a pitch by TeraTech for Fusebox and their services and a lot of attendees were pretty annoyed by it).
Then Ben Forta and Adam Lehman took the stage and, after about half an hour of the usual "good news" about the state of ColdFusion, they launched into the meat of their presentation: announcements and then new features that "may or may not be in" the next version of ColdFusion that "may or may not be called CF9".
First off, the announcements:
- ColdFusion will be free to students and faculty in much the same way that Flex Builder is today. The exact details are still being worked out so watch the Adobe site for more news.
- The CFML Advisory Committee. I've already blogged about this and will be blogging more over the next few weeks.
Next, the features (for "will" read "may"):
- <cfscript> will be enhanced to allow functions (both UDFs and CFC methods) to have access declarations, return types and arguments. A new component syntax will also allow entire CFCs to be written using <cfscript>. The applause was somewhat belated but I'm very pleased to see this coming!
- A new scope local will be added to functions make it easier to deal with local variables. You will be able to declare variables with var anywhere in a function (not just at the top). You will be able to specify the default scope for unscoped variables via <cfsetting>.
- We're getting <cfcontinue> as a tag (we've had it in <cfscript> for a while) and we're getting finally and <cffinally> to make it easier to deal with exceptions.
- A new keyword (as an alternative to createObject()) and an import keyword to make CFCs accessible to new - just like Java / ActionScript. Some sort of implicit constructor will also be added.
- Tired of writing all those "best practice" getters and setters? CF9 will have implicit getters and setters auto-generated based on <cfproperty>.
- A Server.cfc will be added to allow for onServerStart() and onServerEnd() handlers in addition to the current application model.
- AIR integration will be improved (I didn't catch any details that were given). They showed some MXML containing <cf:...> tags that defined a datasource and SQL queries that will somehow handle automatic synchronization of data between online and offline operation.
The final feature shown - the "big" feature - was deep integration with Hibernate, the de facto standard Java Object-Relational Mapping engine, so that you can simply specify orm="true" and a datasource on a <cfcomponent> tag and then you can load and save that object against a database table of the same name as the component. More enhancements to the <cfproperty> tag will allow finer control over what parts of a CFC are mapped to what parts of the table in the database.
I think a lot of people were a bit bewildered by the Hibernate announcement because they're not using CFCs yet but I think it has the potential to drive CFC usage by making database access even simpler than ever.
After the keynote, I went to Shlomy Gantz "10 Steps to Ruin a CF Project" which was a wonderfully humorous look at why projects fail. Shlomy told us not to test, not to document, not to plan, not to have a process and so on, illustrating each point with real experiences from his project management consulting past. He said he'd trying telling people the right things to do but it never seems to sink in so he's become bitter and wants to try reverse psychology instead. It was a great session and really brought home the important messages.
During lunch I got caught up in conversations and missed the next two sessions (including Bill Shelton's which I really wanted to see). I popped into the speaker ready room to say "Hi!" to Peter Bell and Joe Rinehart but then Brian Meloche and the cfconversations crew arrived to interview Gert Franz of Railo so I ended up in there for another hour (it was a fascinating interview / roundtable - watch the CFConversations podcast for this episode to appear).
I skipped the networking event (again, a guest pass was $150 for the networking event and the special event and that certainly wasn't worth it) so I had dinner with my wife and then we hung out in the bar with a good crowd.


