Payment Gateways

I am in the market for an online payment processor. Thus far, I've narrowed it down to two options, PayPal and Google Checkout.

This is for a small project I've been working on. I don't expect a ton of revenue and would prefer a solution that doesn't need to be monitored nor babysat.

It would be most helpful if the setup was as simple as possible because this is a small project and if processing payments means a few weeks work, the project becomes fairly useless.

Scott Pinkston has a project on RIAForge for Google Checkout. Has anyone used this cfc? Are there other resources out there for integration? Am I missing another good service? Have YOU had a good experience with a simple payment processor?

All advice is appreciated.

Pulling documents out of nested folders

As part of some consulting work, I had to extract documents out of a large zip file. The zip file contained thousands of documents and EACH individual document resided in a directory structure nested 6 to 11 other directories deep. Doing this by hand would be tedious and boring.

Also, the individual files were named with punctuation, spaces and other annoying bits. I wanted to clean those up as well.

I spent a few minutes hacking together a ColdFusion script to do the work for me.


Bender Explained

Toby Tremayne has put forth some code as to how Bender will generate AS objects and connect to Transfer. This is an early first pass and there will undoubtedly be changes, but I am pleased to see he has pushed this stone forward.

In Transfer, your business objects, their properties and relationships to other business objects are configured in Transfer.xml. Bender takes advantage of this 'single source' for object properties/relationships by consuming the Transfer.xml, creating AS classes based of the configured Transfer objects as well as a wrapper for Remoting to the back-end TransferFactory. I believe Chris Scott called the Bender Architecture a 'Remote Command Factory'.

Looking forward to more posts on Bender. Maybe Toby will come to #CFFlex again so I can Bender his ear. (Todo: Remove Bad Pun)

OO and Lines Of Code

I've seen more than once, a person asking on a mailing list about a more 'OO' way to solve a problem. Often, this comes with the expectation of less lines of code to write. Certainly, as programmers paid to provide solutions, not lines of code, we want to deliver a tight and concise code base, however, OO is not about reducing the lines of code it takes to solve a problem.

Encapsulating a problem requires MORE code initially. Accounting for variability, for future extensibility and for the sake of clean architecture, it might take double or triple the lines of code than a procedural solution.

The benefits of OO come down to extensibility and to maintainability. Having a specific solution stuck neatly and tidily into a corner of your application will make alterations and enhancements easier. Often, the "OOOPs, I missed that one" problem is solved because there is less, or no code duplication.

Certainly, the more a particular encapsulated solution is used in an application, it will result in a reduction in overall lines of code. You won't see this benefit when you write the solution the first time. You might even ask yourself, "Why did I write all that code, just to do 'x' "

I've recently picked up some consulting work on a procedural application running CF 4.51. I spent a few years working on that particular version of ColdFusion and wrote some good software. CF 4.51 has no components, no UDFs, no StructAppend and no CFDump. If I occasionally get frustrated with OO, spending an hour or two with the 4.51 based code and it's highly procedural architecture, prove that OO is worth the time. The time it takes to invest in yourself,to learn OO and in extra time to initially code the application.

So as you explore and learn Object Oriented programming in ColdFusion, be careful of how you set your expectations. OO can be quite frustrating and annoying at times. The benefits might not be what you initially expect. The rewards come later.

Pricing for BlueDragon.NET 7.0 Standard Edition - $1999/server

Newly released on Vince B's blog, 7 pricing. For a long time, the Blue Dragon product had the reputation as being the "Cheaper" cousin of ColdFusion, but no longer.

I don't currently have pricing for Scorpio in front of me, but it seems as if BlueDragon now has the reputation for being the "More Expensive" cousin of ColdFusion.

I, for one, appreciate New Atlanta in the CFML engine marketplace. The competition has been good for the state of the art, if perhaps not for the profits of Adobe nee Macromedia. New Atlanta has several 'firsts', one being cfthread, another being cfinterface.

With that said, the last time I had a decision about which CFML engine to use, I went with ColdFusion Enterprise. I felt the price justified the expense because ColdFusion is the Gold Standard for CFML engines and CF Enterprise and BD enterprise are priced equal. I specifically avoided using the BlueDragon product line because of certain incompatibilities with popular CF Frameworks. Even at a lower costs, the issues and limitations were too much of a negative.

I understand some CFFrameworks vs. BlueDragon issues are resolved. In fact, Peter Farrell announced on a recent cfweekly podcast that he was able to use MachII 1.5 and the ColdSpring BER on top of BlueDragon.

Still, one has to wonder if the 2k entry price for BD Standard is on the mark. It is certainly ~800 more than CF Standard. Of course, I am a lowly programmer and I don't have bastions of Market Research professionals scouring the market with surveys and the like. Nor do I have years of experience developing boxed commercial software like Vince B. and co. ( If you don't already know, Vince has been behind some very successful and innovative products in his time.)

Will there still be a 'free' BlueDragon product? Will hosting companies provide BlueDragon on their CFML hosting plans? Will Adobe counter will a Hosting Specific version allowing cheaper hosting prices? Stay Tuned to the War of the CFML engines.....

Update 1: The reporting above is slanted and inaccurate, like most of my postings. There are some good comments below adding balance. My biggest error was in failing to differentiate between BlueDragon.Net, and the other products in the New Atlanta Stable. Have a look at the Product Matrix. Also Vince B. states "Finally, yes, there will continue to be a free BlueDragon edition--we have no plans to change this. Pricing of the Java-based editions in the BlueDragon Product line remain unchanged." I did not know this and it is certainly good news for the many using BD. Have a read through the comments for a more balanced perspective.

The proud owner of a ticket to the CF.Objective conference

I am registered for the cf.Objective() conference!

I REALLY REALLY wanted to go last year. My plans were derailed by deadlines at work. Not wanting to miss two in a row, I registered early. Now, I have no excuses.

Minnesota in May is a nice time. Really, it is. After a nice long Jersey winter, I can say how grateful I am the conference is in May, rather than December.

If you are on the fence about attending, have a look at the sessions. Should be an action packed conference for sure.

Oh, if you need ammo to convince any pointed haired bosses, have a look at The Managers Guide.

Passing querytext as a function argument OR When is a string not a string?

Today I wrote a function that added in default rows to a query. Part of the function needed the text of a query to find the default values. I attempted to pass in the query text and use the same text in a <cfquery> tag.

This did not work.

Here is the query I passed in:

view plain print about
1SELECT This, That FROM Those WHERE bar = 'foo' ORDER BY SortOrder

Here is the resulting error:

view plain print about
1Error: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near 'Foo'.


Closures in ColdFusion

I've been reading Sean Corfield's examples on how to use the Closure library. This still seems a little mystical to me since I haven't made use of closures in programming before.

To ease my befuddlement, I wrote a test for the Closures library. The use case for the below example is summing a column that contains non-numeric values. You can recreate the test by following these steps:


Promote ColdFusion (CFML)

The "frighteningly" evangelistic Rey Bango, newly anointed into the JQuery Evangelism fold is a long time ColdFusion programmer.

Rey kicked off a new project called to spread the good word about the vitality and strengths of ColdFusion and CFMX.

There is an article on at the moment and it could use an few nudges north. Give a Digg for ColdFusion, would ya?

Still need convincing?

So you want to create a ModelGlue:Unity application? ( Part 10 )

Sean Corfield pointed out that using ColdSpring to make instance (throwaway) components is quite a heavyweight approach for a simple form bean. He is, of course, correct. Our ContactFormBean is currently created by ColdSpring. In this series, we will add a factory object that will make our instance beans for us. The factory itself will be configured through ColdSpring as well as the configuration for our objects.

This is a very simple factory. It has three methods, GetConfig, SetConfig and getBean. In turn:

  1. getConfig() returns a struct with keys = objectnames, and values = paths
  2. setConfig() provides an interface for ColdSpring to set the configuration struct.
  3. getBean() gets the path for a specific object from the configuration struct and returns a created object.
Note: the getBean() method runs an init() method on the newly created object. This is considered a convention in CFCs.
view plain print about
3    <!---     Author: dwilson Date: 3/14/2007 Usage: I return an instance object     --->
4    <cffunction name="getBean" output="false" access="public" returntype="any" hint="I return an instance object">
5        <cfargument name="ObjectName" type="string" required="true"/>
6        <cftry>
8             <cfreturn createObject( "component", structFind(getConfig(), arguments.ObjectName ) ).init() />
10             <cfcatch type="any">
12                <cfthrow message="BAD_OBJECT_CONFIG_IN_INSTANCEFACTORY" detail="You provided [ #arguments.ObjectName # ] and I can't create it. Go check the config." />
14            </cfcatch>
16        </cftry>
18    </cffunction>
20    <!--- Usage: GetConfig / SetConfig methods for Config value --->
21    <cffunction name="
getConfig" access="public" output="false" returntype="any">
22        <cfreturn variables.instance.Config />
23    </cffunction>
25    <cffunction name="
setConfig" access="public" output="false" returntype="void">
26        <cfargument name="
Config" type="any" required="true" />
27        <cfset variables.instance.Config = arguments.Config />

28    </cffunction>

To use this instance factory, add the following ColdSpring xml snippet to the ColdSpring.xml file.

view plain print about
1<bean id="instanceFactory" class="ContactManagerMG.model.InstanceFactory">
2     <property name="Config">
3     <map>
4     <entry key="ContactFormBean"><value>ContactManagerMG.model.ContactFormBean</value></entry>
5     </map>
6    </property>

Now remove the original ContactFormBean configuration.

Next, open the Controller.cfc file and change each instance (getContactForm, handleContactForm and removeContact) of getModelGlue().getBean("ContactFormBean") to getModelGlue().getBean("InstanceFactory").getBean("ContactFormBean") .

Finally, reinitialize your application and click on the ContactForm tab. You should see your form as before.

A factory might seem like overkill right now, since this is a simple application. However, Factory objects are a good pattern to learn. Our motivation for the factory in this case was to reduce the amount of unnecessary processing incurred by using ColdSpring to make a simple form bean. We could however, expand our factory to take additional parameters and create all sorts of dynamic objects for us.

In a later series, we'll do just that.

Download Download