On Friday, Sep 19, 2003, at 18:42 US/Pacific, Adam Churvis wrote:
> I'd like to get your opinion on something else, if I may. If a system
> makes
> extensive use of a good-sized library of custom tags throughout an
> application (virtually on every page), and the logic and display tasks
> handled by them are truly best implemented as custom tags (many of
> which
> internally call components that interface with the persistence layer),
> wouldn't using CFIMPORT on every page (which redundantly re-imports the
> entire library of custom tags with each page request) be considered a
> second-best approach in favor of discrete calls via CFMODULE
> template="" to
> just those custom tags needed on each page?
See my other email - <cfimport> is a compiler directive that creates no
runtime overhead. The great benefit of <cfimport> is that it allows you
to create 'namespaces' for custom tags so that you can use a nice,
clean syntax for calling custom tags but without any ambiguity about
where the tags actually live.
> I can see using CFIMPORT for the occasional call to a custom tag in a
> relatively small library (or subdirectory of a library) of custom
> tags, but
> it seems to me that when you have a lot of them and use them just about
> everywhere that CFMODULE template="" is the best approach, both from an
> architectural and a performance point of view.
Actually, no. <cfimport> is cleaner since you end up with regular tag
syntax:
<prefix:mytag attr="value">
stuff here
</prefix:mytag>
Instead of:
<cfmodule template="/path/to/mytag.cfm" attr="value">
stuff here
</cfmodule> <!--- end of mytag call --->
Note how you'd need a comment on the closing cfmodule tag (if "stuff
here" was long enough that you couldn't see both start and end tags on
a single page) whereas the <cfimport> format let's you close the custom
tag with it's name!
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137790
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com