May
10ColdFusion as a Different Type of "Glue" - cf.Objective() presentation - and real world OO
Posted By: Brian Meloche; Posted At : May 10, 2008 4:07 PM
Related Categories: ColdFusion, Speaking, Conferences
For those of you who have requested it, here is a copy of my presentation from cf.Objective().
People seemed to enjoy the presentation. The presentation deals with using ColdFusion to interact with an ERP system. The problem is complex enough that sample code is not really possible without a lot of work, so this presentation did not have code. I didn't get a lot of complaints about that because the session was detailed enough that it didn't NEED code.
One thing that I hit on during the presentation that has more of a wider scope and was also covered by Nic Tunney in his preso. My idea is simple: You really shouldn't try to make ColdFusion do things it's not good at doing.
ColdFusion bogs down when it needs to create a lot of objects. If you are retrieving a LARGE result set for read only purposes, you shouldn't create an array of objects. If a query will do, use a query. If not, use an array of structures. I will often add a getWidgetsAsQuery or getWidgetsAsArrayOfStructures service method and create a transfer object (not to be confused with Mark Mandel's Transfer) to give me the ability to create an array of structs instead of creating an array of objects. When you are dealing with a class with many methods and/or a large array, you will get a big performance hit, even in ColdFusion 8. On add/edit/deletes, a bean is well suited, but not on gateway style selects. You can try to get around that by going around it and doing your model in Java, but, to me, that doesn't seem like a great idea unless you NEED to (sorry, Andy P!), as doing that gives up what ColdFusion is best at in the first place - Rapid Application Development. Instead, work to ColdFusion's strengths would be my suggestion. I may be criticized by some as not being a "thought leader", but that's a crock of sh*t as far as I am concerned. As my slide says, I am not a Spock when it comes to being a CF developer. I'm a Scotty, and I'll take real world experience (using sound fundamentals) over theoretical constructs every day. During pure OO in ColdFusion is just that - a theoretical construct - and it fails in real world situations. Use OO where it makes sense, which is in MOST places, but don't try to use it everywhere in every situation.


There are no comments for this entry.
[Add Comment] [Subscribe to Comments]