|
Recent
Articles |
What Employers Seek In Oracle Candidates There are hundreds, if not thousands, of high tech computer jobs open for those with Oracle expertise. The highly reputable and popular Oracle products are used by firms in every part of the globe. As a result, experts...
Important Issues Regarding Database Tools The sql server primary query language is Transact-SQL, an implementation of the ANSI/ISO standard Structured Query Language (SQL) used by both Sql server express and Sybase. SQL Server is commonly used by...
DevWeek: Day 2 Recap Niels Berglund's "ADO.Net v.Next and the Entity Framework" was the first lecture of the day, I decided to skip Dino Espistos lecture after I read his slides...
Record Locking In SQL Server Pessimistic and Optimistic Concurrency. In a multi-user environment, there are two models for updating data in a database: optimistic concurrency and pessimistic concurrency. Pessimistic concurrency involves locking...
Installing Fusebox A quick editorial note. I mentioned last week that I would be playing with Fusebox and trying to learn the basics. In case anyone comes in via Google I wanted to be clear that these are my experiences as I learn. So please...
|
|
|
Recent WebProNews Articles |
Parents Obsessed With Google Baby Names Have we really reached a point where people are going to worry about how and where their progeny's names appear in Google's search results? Parental competitiveness has always been with a lot of people. Whether they...
Mom's Guide To Social Marketing Your mother, if she did her job right, taught you everything you need to know about how to get along in the world and how to get ahead in it. When we were...
Google Finance Cashes In Updates Some new features arrived in Google's Finance site, with the big addition being content from events like earnings announcements and analyst calls. Ever since Google Finance launched, it has been compared regularly...
Google Patent Defines The Sandbox If there were any doubt new sites may be spending some time alone on part of the playground, a recent Google patent application seems to define a place where...
Technorati Adds Authority, Subtracts Alexa Blogs have a new number, Technorati Authority, attached to their profiles on Technorati, and that change was followed by the removal of Alexa traffic charts. Technorati looked a little different over the weekend, as bloggers...
|
|
|
 |
|
05.09.07
CfObjective - Mark Mandel & Transfer ORM
By
Raymond Camden
(As before please pardon the writing.)
The problem that we need to solve is writing all the objects that model your database. This is a long and painful process. The basic creation by itself is bad - but it gets worse when you make updates to your database.
ORM (Object Relational Mapping) can help us solve this problem. An ORM can generate your INSERT, UPDATE, DELETE, and SELECTS for your objects. It can create objects for you to work with.
So obviously this saves you time (and money!).
Transfer is an ORM for ColdFusion. It creates generic 'TransferObjects' defined by an XML configuration file. It generates transfer files which are basically a library of UDFs.
Transfer runs on MSSQL 2k, MySQL 4, Postgres 8, Oracle 9. Needs CF 7.
Transfer can generate business objects on the fly (no need for code, but you can write code if you need to). Generates all your SQL for you. Handles object composition. Generates list queries. Proides caching.
Installing is simple - copy transfer folder to application root. 2 XML files. One defines datasource. One is a configuration file.
configuration.xml:
package elements define organization of objects (just for org, nothing more)
object elements map Objects to table
id defines primary key
property defines columns
Transfer supports multiple composition types: many to one (each blog post has a single user), one to many (each blog post has multiple comments), many to many (multiple blog posts have multiple categories)
Transfer supports lazy load. This means it won't get child elements unless you really want it. Didn't hear if this was default. I believe it is NOT the default. Good feature though to have.
Transfer Decorators allows for customization (he will be covering this more in the advanced topic).
You start off creating a TransferFactory. CFC takes 3 args - path to datasource config, path to config file, and where to save files. Factory has an API to get the datasource (useful for other CFCs), and a getTransfer that returns our main API.
When you save an object, API supports create, update, and save (where save is smart enough to know if it needs to create/upate).
Transfer can handle creating PKs for you. (Or you can write your own code to handle it.)
To get an object, it is very simple: getTransfer().get(class, key)
You can get by PK, or by a property or set of properties. You can also pass a SQL where clause (although Mark doesn't like this).
Deleting is simple as well. getTransfer().delete(). It does not yet handle cascading deletes.
Getting a list is pretty trivial: getTransfer().list(class). With optional ordering.
Many more features.
His demo is pretty nice. All written using Transfer and no sql.
Summary: So I had not had a chance to look at Transfer yet and from what I see it looks -very- nice. Folks can find out more at http://transfer.riaforge.org/ and http://www.transfer-orm.com
Comments
About the Author: Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com
Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.
|