Mark Mandel on Transfer, ORMs, and cf.Objective() 2007

 
Mar 16, 2007

by Judith Dinowitz

Mark Mandel, creator of the Transfer framework, took the time to talk to me about his upcoming visit to the US at the cf.Objective() Conference (http://www.cfobjective.com), May 3-6, 2007, in Minneapolis, and his plans for the next release of Transfer.

Judith Dinowitz: Hi, Mark... It's great to talk to you today... I hear you're going to be at cf.Objective()?
Mark Mandel: Yep! I am coming across this year. I figured it was about time that I actually got a chance to meet a lot of the people I talk to online about ColdFusion, and it also gives me a chance to present on Transfer.
JD: So what made you choose cf.Objective() over other conferences?
MM: The quality of the content at cf.Objective() was what drew me over. I tend to develop at an enterprise level, so when spending money to travel across the US, I wanted to make sure that I could get the most out of it.
JD: So you think the quality of the presentations will give someone like you – an advanced developer – an edge that other conferences don't?
MM: cf.Objective() is targeted specifically at enterprise-level development. Generally speaking, other conferences try and reach a broader audience, and rightly so, because there is a huge market for this. However this means that advanced developers that are looking to learn something new may well be forced to listen to a lot of information they already know to find the small part that they didn't.
JD: Good point! And there will be many developers who may want to find out about using Transfer in their application development... I notice that you're doing two sessions on Transfer. Why split it up into two?
MM: The main reason is that Jared asked me to. But in reality, it's mainly because there is SO much information that I can talk about on Transfer that it's impossible to keep it to one session. My introductory presentation is already splitting at the seams, so trying to pack in information for a more 'enterprise' audience was simply out of the question. A second presentation was just a necessity.
JD: Sounds like Transfer has a lot of meat to it. What do you think is the biggest barrier for intermediate and advanced developers who are trying to get into Transfer? Is it the amount of information they need to know, or is it something else?
MM: Honestly, I'm not sure if there is a huge barrier for advanced developers – especially for those developers who already understand the basics of ORMs and the like. They tend to pick it up pretty quickly. The barrier seems to be for beginner and intermediate developers who may not know about ORMs, who often struggle with the 'what does this do for me' part of the equation, and the more conceptual parts of the framework. That being said, the Transfer user base has been extremely helpful in fleshing out that part of the documentation, including a substantial overview and FAQ for the next release, which I think will help out a lot of people.
JD: That's great... When is the next release coming out?
MM: The next release is in its final stages of bug tracking, and I still have some documentation to write, but I'm pushing hard to get a release candidate out before webDU, which is next week.
JD: So the new documentation and FAQ are already live on the Transfer website?
MM: Currently they are only available to those who are on the mailing list, as it has been a corroborative process between myself and the user base on the mailing list. It's been a great process, and much thanks needs to go out to Jaime Metcher, Nando, and Aaron Roberson for being the main contributors. When I release the release candidate, I will make the documents public.
JD: I'm sure the documentation will be much appreciated by developers who are learning Transfer. So the new release of Transfer will have a lot of new features?
MM: The next release of Transfer has several critical bug fixes, as well as two new major features, the first being a new Observable event called 'onNew' which can be Observed by other CFCs. This is primarily a way to enable developers to inject other CFCs into their generated TransferObjects when they are first created.

The second is a feature called Transfer Query Language. This is a really big new feature, and enables you to do several new things. Essentially, it enables the developers to do database queries, but through a language that mimics the object relationships that they have defined in their configuration file.
JD: Wow.. Both features sound like they'll add a lot of new possibilities for Transfer applications... especially Transfer Query Language.
MM: I think TQL is going to be a powerful new feature for Transfer, and while it has yet to be documented properly, those that are already playing with it are enjoying it a lot.
JD: How does TQL work? Is it built on SQL?
MM:

TQL works essentially as another layer of abstraction between the database and the Object model that the developer has created. For an example, if I had a Blog system, which had Posts, which had an Author and a series of Categories that is also belonged to, I could do a query to return me all those results like so:

query = getTransfer().createQuery("from post.Post as Post join user.User as Author join
system.Category order by Post.createdDate");

where post.Post, user.User and system.Category are all objects that have been defined in my Transfer configuration file.

JD: So query is a verb in your Transfer Query Language?
MM: There is a TQL Query object that is used in these operations, that also allows for more features of TQL to be used – i.e., being able to set mapped params, telling the query to be distinct, whether or not to tell the query to Alias the column names to the property names defined in the Transfer configuration file, and also whether or not to cache the evaluation of the TQL.
JD: So that query object is createQuery?
MM: That query object is returned form 'createQuery()', yes.
JD: The query object is created in that code example and returned from the createQuery function.. So Transfer is actually creating its own queries using TQL...
MM: Exactly! The TQL gets resolved into the correct SQL, without you having to lift a finger.
JD:

Hmm... Can you explain the code example you gave?

query = getTransfer().createQuery("from post.Post as Post join user.User as Author join
system.Category order by Post.createdDate");

What is query here?

MM:

Query is an instance of a Query.cfc, which is the holder for information about the TQL script.

createQuery("...") returns an instance of a Query.cfc object based on the TQL script provided.

Are you with me so far?

JD: Yes.
MM:

Okay. There are attributes on the query object I can change. For example:

query.setDistinctMode(true);

This means that when I finally ask Transfer to evaluate the TQL that is held in the Query object, it will be a 'SELECT DISTINCT'.
Are you with me still?

JD: Yes.
MM:

Cool. Now, when I want to evaluate my TQL into an actually ColdFusion query result, I can have:

qResult = getTransfer().listByQuery(query);

This translates the TQL into SQL, and returns the result from the database. Does it all make more sense now?

JD: Yes... So you are trying to make it easier for developers to create queries that will work natively within the OO paradigm?
MM: Yes, that is exactly what it enables you to do. You already have a set piece of knowledge about how your model is built. TQL means that you don't have to concept shift in your head when you go to create queries on your database. And it also means that you can write less actual query code, and Transfer already knows about the relationships in your system. There is still a definite place for good ol' fashioned SQL queries, but this is just another tool in your tool belt.
JD: I assume that your first Transfer presentation will deal with the basics of what an ORM is, for the benefit of those intermediate developers who are still unclear on that...
MM: That is exactly what it does. We do a good deal of covering of the why you would use a ORM, and then we go into some of the basics of how to use Transfer.
JD: And these new features we've been discussing will be part of your advanced talk?
MM: Yes, the advanced talk will cover aspects of the caching mechanism, Decorators, TQL and Transfer Observable Events.
JD: So those who are familiar with Transfer and ORMs but want to get updated on the latest capabilities should attend the Advanced talk... Will intermediate developers who attend the basic talk still get something out of your advanced presentation?
MM: I definitely think so. While the advanced talk will be coming from the perspective that you already are familiar with Transfer, if intermediate developers attend the initial talk, at the very least they will go away with some ideas in the back of their minds that will probably turn on some light bulbs down the road.
JD: Now I wish I were going to cf.Objective() – Your talks sound so fascinating!
MM: Well, I hope so. I've put a fair amount of time and effort into Transfer, and I'm really proud of the project... Strangely enough, that means I can talk about it for hours on end. Hopefully we will get a chance to meet in person next year.
JD: Hopefully! By then, I'm sure I'll be on the conference circuit again. Mark, before we go, is there anything else you'd like to tell our audience?
MM: I'm really looking forward to coming to cf.Objective. It's going to be a great chance to actually chat to a lot of people I only know through text. So if you see me somewhere in the halls, please feel free to pop over and say Hello. Also, make sure you check out the Fusion Authority Quarterly Update article on Transfer that is coming out shortly, in issue 3. It is a really good article, and a great read for anyone who is interested in Transfer, or if they are already using it, and are looking for a refresher.
JD: Thank you, Mark. It was a pleasure speaking to you today! Good luck on the next release of Transfer, and have fun at cf.Objective().
MM: Mark: Thanks Judith, always a pleasure!

Those who wish to enjoy Mark's presentations at cf.Objective can register at http://www.cfobjective.com/conference/index.cfm?event=page.register. The early bird price for all three days of the conference, which ends on April 1, 2007, is $395.


Judith Dinowitz is Editor-in-Chief of Fusion Authority, the House of Fusion Technical Magazine, and the Fusion Authority Quarterly Update, the House of Fusion Print Journal. She is well-known as the CFEditor, having worked on many articles and books for other publications.

Privacy | FAQ | Site Map | About | Guidelines | Contact | Advertising | What is ColdFusion?
House of Fusion | ColdFusion Jobs | Blog of Fusion | AHP Hosting