On Mar 3, 2004, at 5:46 AM, Roland Collins wrote:
I was wondering about the way this example is written . . . aren't two
instances of the contact component being created in the example that calls
the WS? Would it maybe be better form to define separate contact and
contactmanager cfcs?

Mike Collins, the author, has responded on my blog, to some comments made about the Tech Note:


http://www.corfield.org/blog/past/2004_03.html#000338

Basically you have a CFC acting as a Web Service and also as a container for the data to be returned. That's quite common in C++ and Java where you have static methods that construct an instance of the class to which they belong and return it (factory methods). But of course in CF, there are no static methods so an instance is created by the Web Service call itself. Whether the overhead is a big deal will depend on your specific situation but Mike's way of writing it is fairly solid OO style (barring the "this" scope references and lack of "var" declarations).

Sean A Corfield -- http://www.corfield.org/blog/

"I'm trying to ban e-mail attachments.� I just want an ASCII e-mail.
 If you want to show me something, put it in a Web page, publish it,
 give me the URL, and I'll look at it.� That's the new model."
-- Scott McNealy, CEO of Sun Microsystems, in May 1997 Upside magazine.

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to