Are you asking if you need to write a Java wrapper class for an existing
Java class to use it with CFMX or whether you need to write a wrapper
CFC for using an existing Java class with CFMX? I'll go ahead and answer
both questions.

Some Java classes are hard to make use of with CF because of Java being
a typed language while CF is a typeless language. For example, if a
method of a Java class returns a Hashtable it is going to be hard to
call it from CF since there is no equivalent in CF. With CFMX this can
be fixed by creating a wrapper class in Java that simply calls the
desired method and casts the result into a HashMap and then returns the
result to CF. CFMX will automatically cast a HashMap into a struct.
However, if you aren't using CFMX, you would need to attack the problem
a completely different way. One possible solution would be use to a
specialized Hashtable class. For an example of this check out the
following article I wrote
(http://www.devx.com/java/free/articles/liotta01/liotta01-1.asp).

On the other hand, if you question was more about using Java classes
that were built with CF in mind; then no, you don't need to create a
wrapper CFC. I have just found it to be useful to have a well defined
interface between my CF and Java code. It doesn't really add much
overhead, but could make things easier at a later date depending on how
requirements might change.

-Matt
 

> -----Original Message-----
> From: Paul Hastings [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 26, 2002 12:18 AM
> To: CF-Talk
> Subject: Re: Apache Xindice article
> 
> > I went ahead and wrote a quick CFC just to show how easy it would
be.
> > You can now go to http://devilm.com/writing.html to download the
Java
> > class and its associated CFC wrapper.
> 
> is it a fact of life (or my newness to java) that you almost always
have
> to
> write a wrapper class to use java w/cfmx? i've found myself having to
> learn
> java to use existing classes to extend cfmx's i18n functionality.
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.372 / Virus Database: 207 - Release Date: 20/6/2545
> 
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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