So, a week ago I asked about getting meta data without instantiation and got
no response.  But, at the end of that message I asked a related but separate
question that I still think is worth discussing.

The issue is that all documentation code I've seen for CFCs, including the
built-in documentater code, creates an instance of a CFC.  The implication
is that if you have code in your "pseudo-constructor" area it will run when
you go to view/create the documentation.  Although it's not really a "best
practice" to do much, if anything, in the pseudo-constructor, it's certainly
not unheard of.  For instance, keeping a log of instantiations, setting
variables in the application/server/session scope when building facades,
etc.

So, are people just not running into this because they don't do any external
"work" in their pseudo-constructors?  Are they just accepting that it's a
fact of life?  Are they unaware of the potential for badness?  Is there a
work-around I'm unaware of?

 - Nathan





> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Nathan Dintenfass
> Sent: Friday, March 19, 2004 7:22 PM
> To: [EMAIL PROTECTED]
> Subject: [CFCDev] meta data from an absolute path without instantiation?
>
>
> I am trying to get meta data from a component using the absolute
> path to the
> .cfc file without needing to instantiate.
>
> Matt Liotta showed a trick back in the day that looked like this:
>
> <cfset tp = createObject("java","coldfusion.runtime.TemplateProxy")>
> <cfset md = tp.getMetaData("test",getPageContext())>
>
> However, that has two problems for my needs:
>
> 1) It doesn't take an absolute file path
>
> 2) It doesn't give full meta data if the component wasn't otherwise
> instantiated at another time on the server (which I just
> discovered and is a
> bit odd, if you ask me).
>
> I am also very curious: the built-in documentation engine apparently does
> create an instance in order to do documentation.  But, this means any code
> in the constructor will run.  That means that if, for instance, there are
> database calls or other "persistent" changes made in the code in the
> constructor area that code gets run in order to see the documentation.  It
> also means that if, for instance, you refer to an application variable in
> your constructor you can't use the documentation since that application
> variable won't exist inside the documentation application (again, best
> practices aside).  That seems like a potentially big problem since even if
> it's not good practice it must happen all the time.  So, does
> everyone else
> have some great work around I am not aware of, or are they just
> not actually
> using the meta data driven documentation of CFCs?
>

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