Dec 29, 2009

Are you using ColdFusion 9's ORM?

I have been playing with the ORM in ColdFusion 9 since the beta's I think its a really nice feature and helps make coding fun.   Recently I have not had the chance to work with CF9 so I'm not massively involved in how to solve all the issues going from traditional SQL to and ORM model but in the past few days I have been helping out a friend with a ColdFusion project and I suggested he use ORM rather then creating tables and building all the SQL himself.  Being unfamiliar with what an ORM does I did my best to explain it and this is where I think understanding OO can help alot as he got the concept in less then 5 mins and was coding from examples in about 10 mins ( all in script BTW ).

With a few examples and a bit of light discussion the project began and rather then creating tables and writing SQL he wrote some CFC's and used the ORM in CF9 to do alot of the boring stuff.  Now this isn't a massive project and the actual functionality is a small admin section to a site but it goes to show that ORM can save time and is a viable option even for small projects.

I'm not sure if ORM is available in shared hosting?  In this instance it doesn't matter as there was a full server to use.  So far so good and really the only issues we have is sometimes we need to restart CF to pick up application changes as some times applicationStop() just didn't seem to work 100% ( but not reproducible consistently so probably something we did ).

So are you using the ORM on big or small applications?  And has anyone had experiecne with ORM in shared hosting?

4 comments:

  1. I've had similar experiences and have found it fun to just make changes to the entity CFC's and not have to do any DB or CRUD work. Really makes RAD a lot quicker.

    I've never had a problem using ormReload() to pick up changes. Also, I don't know anyway to disable ORM so I can't see how it would be disabled in shared hosting (or frankly even be much of a problem).
    ReplyDelete
  2. I've had reservations about using it in shared hosting/small apps due to comments I've read about potential (bad) implications of many apps using Hibernate on a single server, but I'm not very knowledgable about Hibernate. I tried to express these concerns in a recent blog post of mine, but from the comments I'm not sure people got the point of what I was trying to say (or ask) and it somehow became a "debate" about shared hosting vs. VPS vs. dedicated hosting:
    http://objectivebias.com/blog/entry/is-coldfusion-9-orm-an-enterprise-only-feature
    ReplyDelete
  3. @Blitz yes it was your post that got me thinking about ORM on shared hosting. The only shared hosting I have right now is CF8 so I can't try. Although I did have CF9 Beta hosting with hosttek now that was Beat and it did work without issues so maybey it will "just work" in a shared hosting environment. I guess at this point I'm lucky to have a VPS with a CF9 key ( that I won ).

    @Sam Ha ha I forgot about ORMReload() thanks for the reminder.
    ReplyDelete
  4. Yeah, I don't have any sites up on shared hosts with CF9 either. I have Railo running on my VPS accounts, so once they come out with Hibernate integration I'll be able to try it out on my VPS.
    ReplyDelete