> Woops, typo, I meant import (not cfimport).

Import is totally unneeded in Java; you can reference any class by it's full
path.  Both of these are the same:

  import java.util.*;
  ...
  List myList = new ArrayList();
  ...

and

  ...
  java.util.List myList = new java.util.ArrayList();
  ...

The 'import' statement is only so you don't have to have the full package
everywhere.  It doesn't let you access anything you couldn't access without
it.  Currently in CF we don't have an option to use an 'import'-like
statement, so we must always use the full package.  The CFIMPORT tag does
something completely different, and probably should have been named
CFTAGLIB, but too late for that now.

> Since that's clearly the better way to handle the utility functions, 
> under what conditions do you find yourself using UDFs?

Very rarely.  The most common place is if I've got a template (usually a
display template) that has some kind of recurring "thing" that can be
encapsulated in a function.  For example, on a reporting screen, I need to
render dividers between 5 sections.  Each one is the same, except for the
title, so toss that into a function and call it 5 times with the title as an
argument.  Such functions aren't architectural artifacts like your function
library CFCs are, they're purely implementation details <i>of the file they
are in</i>, so pulling them into an external CFC would actually be breaking
encapsulation.

Cheers,
barneyb

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Jay Gibb
> Sent: Wednesday, July 07, 2004 3:56 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] using cfinclude within components (was 
> Serialization of CFCs)
> 
> Woops, typo, I meant import (not cfimport).
> 
> Thanks Barney.  I've started slowly moving my library of UDFs into 
> utility CFCs as you suggest (anytime I need one from a CFC I have to 
> move it).
> 
> Since that's clearly the better way to handle the utility functions, 
> under what conditions do you find yourself using UDFs?
> 
>   - j.
> 

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