Home arrow ColdFusion arrow Adobe ColdFusion Just Got More RAD

Adobe ColdFusion Just Got More RAD

ColdFusion has always focused on making difficult things easy, and with the new features and tools announced for its public beta on July 13, 2009, Adobe seems set to deliver on that goal in a variety of different ways. Keep reading for a close look at how this beta will help simplify the lives of ColdFusion programmers.

Author Info:
By: Brian Rinaldi
Rating: 5 stars5 stars5 stars5 stars5 stars / 20
August 25, 2009
  1. · Adobe ColdFusion Just Got More RAD
  2. · ColdFusion Builder: a New IDE
  3. · Extending ColdFusion Builder with CFML

print this article

Adobe ColdFusion Just Got More RAD
(Page 1 of 3 )

The next version of ColdFusion will include new language enhancements and features, such as Hibernate integration, as well as a new full-featured IDE named ColdFusion Builder. This article will take a closer look at what we have learned so far about the features delivered in the beta version of ColdFusion 9 and Coldfusion Builder, and why they may represent a dramatic shift for the language.

Object Relational Mapping

As object-oriented application development has become the de facto standard in the CFML community, object relational mapping solutions have gained prominence. Object relational mapping (ORM) not only allows you to easily persist objects within a relational database without writing SQL, but it allows your application to easily support multiple database systems with a single codebase. Currently this is supported via third-party libraries such as the open source Transfer ORM.

ColdFusion 9 will now support built-in ORM functionality via the industry standard for ORM, Hibernate. When you combine this functionality with new language enhancements like implicit getters and setters and full scripting support, you can probably see how ColdFusion will offer incredibly fast back-end development for your Flex or HTML/JavaScript application.

Let's look at a simple example. The component below represents a simple user object (user.cfc) that will persist automatically to the database in the "users" table. It is composed of a userType object that is also automatically persisted to the database, with the relationship maintained by Hibernate when the user object is retrieved from the database.

<cfcomponent output="false" persistent="true" table="users">       <cfproperty name="id" column="userID" fieldtype="id" generator="uuid" />       <cfproperty name="firstName" />       <cfproperty name="lastName" />       <cfproperty name="email" />       <cfproperty name="userType" fieldtype="many-to-one" cfc="userType" FKColumn="typeID" />   </cfcomponent>  

The code above also uses the implicit getters and setters, a new feature in ColdFusion 9, as becomes obvious when you look at an example of how to persist this object. The code below will create and populate the object with some sample data. The example below wraps basic CRUD and query methods. The code references userService which, for the sake of brevity, is not included here.  

<cfset userService = createObject("component","com.userService").init() />   <cfset userTypes = userService.getUserTypes() />   <!--- create the user --->   <cfset user = createObject("component","com.user") />   <cfset user.setFirstName("Brian") />   <cfset user.setLastName("Rinaldi") />   <cfset user.setEmail("myfake@address.com") />   <cfset user.setUserType(userTypes[1]) />   <cfset userService.createUser(user) />  

Finally, here's the complex service method that saves the object and any relationships. We'll go over this line by line to make sense of it all next, so don't feel overwhelmed.

<cffunction name="createUser" access="public" output="false" returntype="void">    <cfargument name="user" type="com.user" required="true" />    <cfset entitySave(arguments.user) /></cffunction>

Okay, so I suppose reviewing that code line by line isn't necessary since one line of code does everything (and it's a pretty simple line of code as well).

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials