| |
Last
Updated:
|
Coldfusion: Object Factories And Galleon
By Raymond Camden
Expert Author Article Date: 2007-02-26 In my last post on object factories, I talked about how my attempt to use an object factory for Galleon had led to infinite loop. More than one person told me to switch to ColdSpring and rethink my CFC setup in general (which I agree with), but at the same time I was curious as to why the factory didn't work when I expected it to. Rob Gonda (who had provided the original code) was able to figure out the issue. Let me quickly go over again the process I was using. This is a simplified version of what Galleon is doing and it will lead to demonstrating the bug. First off - the factory's general methodology is to make a CFC and return it to you. However, it is smart enough to create singletons. By that I mean the factory would cache the CFC in the variables so on the 2nd-N calls it would return the cached version. So when Galleon was starting up, it did this: 1. Ask for Message.cfc.So the important thing to note is that because the first process (Ask for Message.cfc) never finished, when Thread asked for a new copy, it didn't load from the cache. That was the problem. If you take the above process and change it a bit... 1. Ask for Message.cfc.Like most bugs - now that I see it (thanks again Rob), it is so obvious I can't believe I missed it. I still need to rework Galleon's CFCs, but I can at least get the new release out. (Look for it tonight.) Comments Add to Del.icio.us | Digg | Reddit | Furl
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. |
| DevWebProIN is an iEntry, Inc.® publication - All Rights Reserved Privacy Policy and Legal |