Why OO Rocks

It is late, I am really, really, tired but I am going to weigh in on this debate over whether OO is worth it or not. I offer this nugget of fun. I wrote a wrapper for the default CFC's created by Illudium a while back.

This is all the code I need to do the following database operations with only the contents of a struct (form in this case): INSERT, UPDATE, SELECT, DELETE, AND UPDATE a many to many look up table

<cfscript>
   databaseService.Update(MyTable, form);
   Select_ARTISTS = databaseService.Select(MyTable, form, orderby, "true");
   databaseService.insertinto(MyTable, form);
   databaseService.Delete(MyTable, form);
   databaseService.saveManyToMany("ORDERITEMS", MyFK, MyFKvalue, manyfield, manyValueList);
</cfscript>

// I even wrote a custom tag for it
<cf_query
   dbaction = "select/upsert/delete"
   table   ="sometable"   
   variables="#somestruct#"
   cflocation="#script_name#?event=action.#section#.#nav#" >


Mind you I am one of those "old skool" CFers that picked up OO in the last couple of years. So it can be done. It just takes some (hard) work, but no harder than learning CF to begin with... No really. It just takes time and deliberate practice and it will pay off. Just like anything else worth while.

Update: 7/20/2009 8:06:03 PM

I was asked about the wrapper for the Illudium CFC's and I will be releasing it later on this week

G OUT!!!

Comments
That's right bitches!! A Free, KICK ASS, Open Source CFML Engine!!

Calendar

Tags

NAVIGATION

Recent Comments

RSS

Search

Subscribe