By golly Ben, that does work (at least in my preliminary tests). How interesting. If 
you were anal about making sure init() was
called, and you had other lazy developers who couldn't be trusted to do it right, you 
could make CFCs like this.

NAT

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Ben Curtis
> Sent: Tuesday, March 16, 2004 12:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] RFC, CFC Best Practices
>
>
>
> > Speaking of init...
> > I don't want to add checks to all my methods to
> > make sure Init() was called.
>
> I've been toying with the idea that all methods are private
> *except* init(), which is public. When init() gets called
> properly and everything works right, then the last thing it
> does is "publicize" the methods that should be public:
>
>    This.someMethod = Variables.someMethod;
>    This.someOtherMethod = Variables.someOtherMethod;
>
> ...and so on, and then "privatize" the init() method itself:
>
>    Variables.init = This.init;
>    StructDelete(This, "init");
>
> ...so it can't be called twice.
>
> I haven't tried it yet. Don't have time no, but I figured I
> could put the idea out there and let y'all find out what's
> wrong with it.
>
> --

----------------------------------------------------------
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