Photo from Chile

CFUnited is Almost Here - Learn about Validations and ORM

As I'm sure many of you are aware, the final CFUnited will be starting in a little over a week. Although I did attend a couple of CFUN's in the past (when they were a one-day event), this will be my first CFUnited, so I'm pretty excited about it. It will be great to meet even more people than I usually do at other conferences, such as cf.Objective() and NCDevCon, and I wanted to give a final plug to my sessions, as I think they will be of interest to a lot of developers. As well, I've made some last minute changes to both sessions to cover some new material.

What Your Mother Never Told You About CF9 ORM

The ColdFusion team at Adobe have done an outstanding job with ColdFusion ORM, which now provides ColdFusion developers with access to Hibernate, an enterprise-ready, open source, industry-standard Java ORM. The documentation on how to use CF ORM in the ColdFusion docs is also quite good, providing most of what you need to know to make use of the features. The problem, however, is that Hibernate is a pretty complex tool, and in order to use CF ORM successfully you really need to understand certain things about Hibernate. This session is designed to teach you some of those things - it will cover material that is not included in the ColdFusion documentation, but that is essential to understand when working with the ORM.

Topics covered will include Hibernate Session Management, Understanding Object States, Working with Detached Objects, Concurrency and Using a Base Persistent Object. We'll also be looking at the new Transaction Management model in the recently released ColdFusion 9.0.1. If you plan on working with CF ORM and are not already familiar with these concepts I think you'll really benefit from this session. It is, however, an advanced session, so if you are totally unfamiliar with CF ORM you may find it a bit confusing.

The session is scheduled for 5:30pm (ouch!) on Wednesday, July 28th.

Automagic Validations for ColdFusion Objects

This session will provide an overview of, as well as a detailed how-to about a Validation framework for ColdFusion. The title is a slight misnomer, as, although the framework was originally written to work inside an object-oriented application, and remains an ideal solution for that, it has recently been enhanced to work with simple ColdFusion structures as well. This means that anyone who is looking for a better way of addressing their validation requirements, both on the client side and on the server side, can now benefit from the framework, even if they are not using objects.

The main benefit of the framework is that it will automatically generate all of your client-side and server-side validations for you, from a simple set of metadata. This frees you from the drudgery of writing similar validation code over and over again, and also eliminates the possibility of adding bugs into your application via your validation code. The framework, called ValidateThis, is being actively developed by myself and a number of other contributors, so not only is it extremely functional and flexible right now, but new features are being added continually. If you are interested in finding out more about it, including exactly how to implement it in a new or existing application (and it's dead easy), I encourage you to attend my session. It will be held at 3:15pm on Friday, July 30th, and is being repeated at 2:45pm on Saturday, July 31st.

I hope to see you at one, or both, of my sessions. If we haven't met before please come by and say hi.

ColdFusion 9.0.1 Now Available - With ORM Goodies

ColdFusion 9.0.1 is now available for download at http://www.adobe.com/go/getcf901, and, in addition to fixing a number of issues with ColdFusion 9.0, it's packed full of goodies as well. The details of all the new features can be found in the New Feature Notes, and the bug fixes and outstanding items can be found in the Release Notes. I think my favourite single new feature is the ability to do a for - in loop with an array, as looping through an array using script has always been a pain. I'm also very happy with some of the improvements to ORM. Here's a high-level summary of the new features, followed by some details on the ORM changes:

  • Language enhancements - including for-in loops for arrays.
  • New script functions implemented as CFCs - including dbinfo, imap, pop, ldap, and feed.
  • Caching enhancements - including the ability to get a handle on the ehCache session.
  • Support for IIS 7
  • ColdFusion Ajax enhancements - including updates cfmap, cfgrid, file uploading and JavaScript functions.
  • ORM enhancements - more details below.
  • Amazon S3 support - the ability to use Amazon S3 storage with most tags and functions that use a file or directory as input or output.
  • Various other enhancements covering areas such as Spreadsheets, AIR Integration, Flash Remoting, Blaze DS, Solr, Logging, Server Monitoring, and more.

ORM Enhancements

Here's a summary of the ORM enhancements in ColdFusion 9.0.1, followed by some details about each one:

  • Support for Multiple Datasources
  • Transaction Management Improvements
  • skipCFCWithError Flag in ormSettings
  • mappedSuperClass Attribute for Components
  • Use EntityNew to Populate a New Entity
  • Support for HQL in cfquery

[More]

I'll Be Presenting at NCDevcon in May

I'm tickled pink to announce that I will be presenting a couple of sessions at the upcoming NCDevCon, dubbed North Carolina's Premier Web Conference, which is being held in beautiful Raleigh, North Carolina on May 22nd and 23rd. As I discussed in a previous post NCDevCon is being organized by the Triangle Area ColdFusion User's Group and is a sequel to the hugely successful and wildly talked about CFinNC.

I will be presenting two sessions:

  • Getting Started with ColdFusion ORM
  • Creating a Twitter / Google Maps Mashup with CF and Open Source Tools

The first session is one that I have presented before, but ColdFusion ORM is an important topic and therefore the committee considered it worth presenting again. The second session will be a fun one. In it I will demonstrate how I used a number of freely available open source tools to generate a Google Map showing the locations of all of my Twitter friends. This is a project that I built some time ago, and is currently available via my site. I'll be making some updates to it prior to the conference and my hope is that the session will illustrate two points:

  1. There are pre-existing ColdFusion open source projects that can be used to fulfill many of your application's requirements.
  2. It's very easy to create something cool using ColdFusion.

The conference itself is still chock full of ColdFusion, Flex and AIR goodness, but also includes a healthy dose of JavaScript, CSS and other web development topics. The schedule with a full list of sessions has been published, and it's top notch. I'm particularly pleased to see some folks whom I met last year presenting this year, including Daria Norris and Jim Leether. There will also be a number of hands-on ColdFusion sessions for beginners, so if you know someone who would benefit from a bit of a ColdFusion kick-start, send them down North Carolina way.

Registration is open, and, just like last year's CFinNC, it's absolutely free. I hope to see many of you there.

Sign Up for ColdFusion ORM Training and Get a Copy of the "Hibernate Bible"

Mark Mandel, and I have decided that we're going to give a copy of the book Java Persistence with Hibernate to each and every student at our Developing Applications with ColdFusion 9 Object Relational Mapping workshop, which is running from May 20-21, 2010 in Minneapolis, MN, which also happens to be the two days immediately preceding the cf.Objective() conference.

I've discussed this two-day, hands-on workshop at length in a previous blog post, so I won't repeat myself here, but one of the goals of the course is to teach you what you need to know about Hibernate to be effective with ColdFusion 9's ORM features. Although the Adobe engineering team have done an excellent job of integrating Hibernate into ColdFusion, it is still essential to understand quite a bit about Hibernate to make appropriate use of the features. Hibernate is a complex beast, and although we'll be teaching most of what you'll need to know in the course, it's always helpful to have a reference manual handy.

There is a lot about Hibernate that is not covered in the ColdFusion documentation, and Mark and I both feel that Java Persistence with Hibernate is the best book currently available on the market about Hibernate. We want to arm our students with the tools they'll need to continue their ORM education after the workshop, which is why we've decided to give a copy of the book to each student.

There are still spaces available in the class, so if you'd like to become a ColdFusion ORM ninja in just two days, and get a free copy of the "Hibernate Bible" as well, sign up today.

Managing Bi-directional Relationships in ColdFusion ORM - Array-based Collections Follow-up

Barney Boisvert made a comment on my last post on this topic, suggesting that a nice way to reduce the amount of code one has to write, and to boost performance, would be to have one side in a bi-directional relationship simply delegate to the other side. This way you are only writing the code to do the work in one object, and it also reduces the number of hasX() calls.

I changed my code to try this technique out, and I quite like it. Because the code is slightly different I figured I might as well write about it here, to keep my posts on this topic up to date.

[More]

Managing Bi-directional Relationships in ColdFusion ORM - Array-based Collections

It's important to know that when you have a bi-directional relationship you should set the relationship on both sides when setting one side. There have been a number of discussions about this on the cf-orm-dev google group, including this one in which Barney Boisvert provides a very good explanation of why this is important. Brian Kotek has also written two articles on the subject in the past. If you're not already familiar with this topic I suggest you check out those links.

The general recommendation for addressing this requirement is to override the methods in your objects that set one side of the relationship (e.g., setX(), addX() and removeX()) so that they'll set both sides, rather than just the side of the object that was invoked. While doing some testing of the new CF9 ORM adapter for Model-Glue along with the new scaffolding mechanism that we're developing I needed to address this issue for a many-to-many bi-directional relationship. I found that there were a few wrinkles that made the task not quite as straightforward as I has originally imagined, so I figured I should share what I came up with.

[More]

Become a ColdFusion ORM Ninja in Just Two Days!

I've mentioned previously that Mark Mandel, the mastermind behind Transfer ORM, JavaLoader, ColdDoc, and now the lead developer of Coldspring, and I have developed an intensive, two-day, hands-on workshop on ColdFusion's new ORM features. We will be delivering that workshop, Developing Applications with ColdFusion 9 Object Relational Mapping, in Minneapolis, MN on April 20-21, 2010 which are the two days immediately preceding the cf.Objective() conference.

Really? I Can Master ColdFusion ORM in Two Days?

You bet you can! This is an extreme hands-on workshop. We won't be lecturing at you, we'll be working with you. For each concept that we cover we'll be writing code together, both the instructor and the students, working towards building a single, working application. Then, once we've done that together, you'll be let loose on your own to practice the concepts again on your very own project, which is yet another application which will be built incrementally using the concepts that you just learned. This means you'll have lots of chances to practice your newfound skills, and, more importantly, to make your own mistakes. You'll either figure out how to fix your mistakes yourself, with the help of one of your fellow students, or with the help one of the two instructors. You'll learn by doing, and what's more, you'll leave the class with lots of examples of working code that you wrote yourself.

This is why we say that we can help you master ColdFusion ORM in just two days. Not only will you be ready to start using it in your next project, but you'll also be in an ideal position to teach it to your fellow developers.

About the Instructors

I've been working with Transfer ORM for a few years, and have been working with ColdFusion's ORM integration since early in the product beta. I've blogged about it extensively, delivered a number of one-hour presentations on the subject and have created and regularly contribute to a Google group (cf-orm-dev) dedicated to discussing some of the more advanced and esoteric topics around ColdFusion's ORM integration.

As for Mark, in addition to creating his own ColdFusion-based ORM (Transfer), he's also worked extensively with Hibernate (the ORM that is integrated into ColdFusion 9) and is considered by many to be the foremost expert in all things ORM in the ColdFusion community. This therefore represents a unique opportunity to learn about this new, exciting and productivity enhancing technology from two people who know it very well, and have real-world experience developing with it.

Do I Have to Be an OO Guru to Attend?

Definitely not! We assume no prior knowledge of ORMs or Object Oriented programming, and the techniques that we teach can be used, if you wish, in a totally procedural application. So you neither need to know OO to join in, nor do you need to learn OO in order to use what you learn in your own work (although we would encourage you to do so). Some experience working with CFCs would be helpful, but we can get you up to speed pretty quickly even if you lack that.

Where is the Workshop Being Held?

As mentioned above, the workshop is running as a pre-conference training session at cf.Objective(), and will take place from April 20 - 21, 2010 at the conference hotel, which is the Hyatt Regency in Minneapolis, MN.

How Much Does it Cost?

We have made the early-bird price into a permanent discount, so although the original price was listed at $1200 for the two days you can now enroll for just $1000.

How Do I Sign Up?

You can register for the training via cf.Objective()'s registration form.

Can Anyone Attend?

Although the workshop is being offered as a cf.Objective() pre-Conference class, you don't have to attend cf.Objective() in order to enroll. So if you've having trouble getting your boss to pony up for a trip to cf.Objective(), perhaps you can convince him or her to at least send you to these two days of invaluable training.

What Topics Will Be Covered?

Here's a summary of the topics that we'll be covering:

  • Introduction to ORM
  • Introduction to Hibernate
  • Configuring ORM
  • Working with Objects
    • Creating an Object
    • Retrieving an Object / Lists of Objects
    • Updating an Object
    • Deleting an Object
    • Arrays of Objects vs. Queries
  • Mapping Objects
    • Ids and Properties
    • Many-to-One Relationships
    • One-to-Many Relationships
    • Many-to-Many Relationships
    • Formulas
    • Collection Mapping
    • Inheritance
    • Cascade Options
  • Hibernate Internals
    • Hibernate Sessions
    • Session Flushing
      • How It Works
      • How to Control It
    • Working with Transactions
    • Hibernate Object State
      • Transient, Persistent and Detached
      • How Objects Move between States
  • Lazy Loading
    • Overview
    • How it Affects SQL
    • Dealing with Detached Objects
  • Concurrency
  • HQL
    • What is HQL?
    • Basic Queries
    • Criteria / Parameters
    • Joins
    • Pagination
    • Bulk Updates
  • Application Architecture
    • Using a Service Layer with ORM
    • Using an Abstract Service
  • Caching
  • Event Handling
  • DDL (Database) Generation

Truly a Unique Opportunity

Although we do have plans to make the course available at other venues in the future, Mark and I live on opposite sides of the planet, and it just so happens that we'll both be attending cf.Objective() this year. It's likely that future classes will feature either Mark or I as instructors, as it's a rare occurrence that we're both in the same place at the same time, so don't miss this unique opportunity.

Looking for More Information?

I think I've covered most of what you need to know about the course in this post, but if you're looking for even more information about it please visit our web site at www.ColdFusionORMTraining.com.

More Entries