If you need to include an identical method in multiple objects, that's
definitely bad OO design.  Assuming good OO design, you'd only ever be
CFINCLUDEing a method into a single CFC, so they're no benefit to having the
code external to the actual CFC file, except perhaps length of file.  With
some of the new tools around (cfeclipse, notably), length of file is almost
irrelevant, since you can easily jump around to the different methods
without having to scroll 'n scan.  Though there's also a strong argument
that large CFC files are an indication of incomplete abstraction and
encapsulation.

So yes, it's possible to use CFINCLUDE inside CFCs without creating any OO
issues, but if it seems necessary, it's a pretty good indication that there
are some problems lurking, since at best, it will only cause zero problems,
it won't ever help a situation.

Now the OO design is not the only thing that CFINCLUDE matters to.  It also
affects file structure.  CFINCLUDEd methods will be unavailable to a
component outline (list of methods) such as cfeclipse provides.  They will
also be unavailable to javadoc-like documentation generators (at least one
of which is in existance, though I don't know if it's publicly available
yet).   So there is a strong case NOT to use CFINCLUDE for methods.

Cheers,
barneyb

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Benjamin S. Rogers
> Sent: Tuesday, July 06, 2004 2:49 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Serialization of CFCs
> 
> > > The bottom line is basically, don't use cfinclude
> > > within CFCs.
> >
> > It would be bad OO practice anyway.
> 
> How so? Reusing code via cfinclude wouldn't really fit into 
> the OO paradigm.
> However, simply including a function body doesn't seem to 
> have anything to
> do with OO -- good, bad or otherwise.
> 
> Regardless, there are apparently some bugs in regards to 
> variable scoping,
> so using cfinclude from within a cffunction should be avoided.
> 
> -ben
> 
> ----------------------------------------------------------
> 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]
> 

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