On Monday, August 26, 2002, at 07:53 , Paul Hastings wrote:
> i'm trying to build a cfc to handle a bunch of i18n formating (dates,
> numbers, etc.) based on some sun/ibm java classes. on a plain page i'd
> just
> cfobject to the classes & then re-use these throughout the page. how
> would i
> approach this with cfc? build a "base" cfc with the cfobject & mutate for
> each of the cfunctions i need? or something else entirely?
I'm not sure what you're asking but I *think* this might help you
articulate your question:
i18n.cfc:
<cfcomponent>
<cfset jObject = createObject("java","some.java.object")/>
<cfset jObject.init()/>
<cffunction name="foo">
manipulate jObject
</cffunction>
<cffunction name="bar">
manipulate jObject
</cffunction>
</cfcomponent>
page.cfm:
<cfset cfc = createObject("component","i18n")/>
<cfset f = cfc.foo()/>
<cfset b = cfc.bar()/>
In other words, wrap the Java objects in your CFC and construct them in
the CFC initialization code (outside cffunction). Have the CFC functions
manipulate the Java objects as needed. Then your page instantiates the CFC
and uses it throughout the page.
Note that I prefer the syntax of createObject() over <cfobject> but you
could use either.
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
______________________________________________________________________
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