Some more info.

With CFMX, it is better to only use custom tags to encapsulate re-usable
presentation logic (ex.: button, menu, nav...) that outputs content.
If you want to encapsulate generic processing function (such as text
formatting), you should use UDF.
(and if you want to encapsulate re-usable business logic, you should use
CFCs)

I understand that you would like to build something similar to a java CFX?
Then build your java class and wrap it into a UDF function (where you will
call your java class with createObject()).

I am not sure that you'll get performance gains by putting the function in
the application scope.
You could do a <cfinclude> of your UDF lib, each time you plan to use it or
you could put it in the application.cfm (then all the pages will be able to
use the UDF library).
I suppose it would the best way to do what you need, isn't it?

Benoit

PS : That's just some personal thoughts about how to organize your code in
CFMX, not universal ones ; ).

-----Message d'origine-----
De : S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
Envoy� : mercredi 21 ao�t 2002 06:41
� : CF-Talk
Objet : RE: CFMX and Java Libraries


> A good link about it :
> http://cfguru.daemon.com.au/archives/000030.html

> I personally like very much how <cfimport> works now.
> (it is very similar to the JSP taglib mecanism, strange
> isn't it?...)

> I don't use the old custom tag naming anymore (<cf_...>).
> All my custom tags are in the "/WEB-INF/cftags" directory
> or somewhere
> inside my application folder (for example :
> "/myapp/system/cftags").

> The prefix system allows you to specify what kind of tag
> you are using, for
> example :
> - <ui:...> for user interface,
> - <i18n:...> for internationalization,
> ..

> It is excellent for code readability.

Ahh, excellent point! :) So I guess what I originally thought of as a
potential annoyance is actually a good thing. :)

I still don't like the fact that they can't be imported in the
application.cfm ...

. Does this also mean that we can't create functions with imported java
libraries? ... Currently I copy all my functions to the application scope so
they don't have to be recreated/reinterpreted on each request, then copy
them back down to the request scope, but it would be so much nicer to be
able to use phormat() instead of request.udf.phormat() for my turbo-charged
paragraphformat() function ( not only does it insert <br> tags for single
line feeds, it ignores any section of the string contained in <pre> <table>
<ul> and <ol> tags -- by default and this list can also be modified ) ...

Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to