<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CF Groovy</title>
	<atom:link href="http://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Thu, 11 Sep 2014 09:58:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Comparators in CF with Groovy at BarneyBlog</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/comment-page-1/#comment-96440</link>
		<dc:creator>Comparators in CF with Groovy at BarneyBlog</dc:creator>
		<pubDate>Fri, 13 Jun 2008 15:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=416#comment-96440</guid>
		<description>[...] wanting to create little ad hoc Java classes in my CF apps in a common occurrence for me.Â  With my CF Groovy project, it&#039;s both possible and very easy.Â  No Java, no compiling, no classloading [...]</description>
		<content:encoded><![CDATA[<p>[...] wanting to create little ad hoc Java classes in my CF apps in a common occurrence for me.Â  With my CF Groovy project, it's both possible and very easy.Â  No Java, no compiling, no classloading [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/comment-page-1/#comment-95794</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Tue, 10 Jun 2008 16:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=416#comment-95794</guid>
		<description>Michael,

Regarless of what my CFML code is (struct.myKey, struct[&quot;myKey&quot;], or struct.get(&quot;key&quot;)), it seems the bytecode should be equivalent.  That&#039;s what compilers are for, no?  However, I wasn&#039;t talking about a CFML reference, I was talking about using a Railo struct within a &quot;pure&quot; Java context.  Within Groovy, Maps have special syntax-level support which doesn&#039;t quite work with Railo structs, because they&#039;re not Maps.  They were Map-like enough to support the syntax constructs, but because they throw an error on a missing key instead of null, it basically make it moot (no &quot;elvis&quot; operator, have to add a bunch of try..catch, etc.).  Both oBD and CFMX use Maps to implement CF structs, so it&#039;s not a CFMX-specific feature, it seems to be a Railo-specific non-feature.

RE the include, this line was the offender:

pageContext.getServletContext().getRequestDispatcher(path).include(pageContext.request, pageContext.response)

The &#039;pageContext&#039; variable is the result of calling getPageContext() within CFML, though that line was actually executed from within Groovy/Java, not Railo.  The &#039;path&#039; variable was set to &quot;/cfgroovy/sample_include.cfm&quot;.  It ended up with infinite recursion, trying to include &quot;index.cfm&quot; over and over again, rather than &quot;sample_include.cfm&quot;.  I didn&#039;t dig in too deeply, I just saw repeated includes of &quot;index.cfm&quot; until I killed the JVM, and so added a conditional so it didn&#039;t run on Railo in the demo.</description>
		<content:encoded><![CDATA[<p>Michael,</p>
<p>Regarless of what my CFML code is (struct.myKey, struct["myKey"], or struct.get("key")), it seems the bytecode should be equivalent.  That's what compilers are for, no?  However, I wasn't talking about a CFML reference, I was talking about using a Railo struct within a "pure" Java context.  Within Groovy, Maps have special syntax-level support which doesn't quite work with Railo structs, because they're not Maps.  They were Map-like enough to support the syntax constructs, but because they throw an error on a missing key instead of null, it basically make it moot (no "elvis" operator, have to add a bunch of try..catch, etc.).  Both oBD and CFMX use Maps to implement CF structs, so it's not a CFMX-specific feature, it seems to be a Railo-specific non-feature.</p>
<p>RE the include, this line was the offender:</p>
<p>pageContext.getServletContext().getRequestDispatcher(path).include(pageContext.request, pageContext.response)</p>
<p>The 'pageContext' variable is the result of calling getPageContext() within CFML, though that line was actually executed from within Groovy/Java, not Railo.  The 'path' variable was set to "/cfgroovy/sample_include.cfm".  It ended up with infinite recursion, trying to include "index.cfm" over and over again, rather than "sample_include.cfm".  I didn't dig in too deeply, I just saw repeated includes of "index.cfm" until I killed the JVM, and so added a conditional so it didn't run on Railo in the demo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Streit Michael</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/comment-page-1/#comment-95775</link>
		<dc:creator>Streit Michael</dc:creator>
		<pubDate>Tue, 10 Jun 2008 15:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=416#comment-95775</guid>
		<description>hi barneyb

you are absolutly right, a railo struct does not extends java.util.Map.
that&#039;s because railo&#039;s struct is optimized for the railo enviroment, it neeeds no interpetation, like a map in cfmx needs. 
why you access a struct via reflection (struct.get(key)) instead of native cf access (struct[key]), every refection access is 1000 times slower than a native access! reflection access on coldfusion object is always the worst decision.

on java level railo can&#039;t be 100% similar to cfmx, only cfmx can this.

what is exactly the problems with include?

greetings michael</description>
		<content:encoded><![CDATA[<p>hi barneyb</p>
<p>you are absolutly right, a railo struct does not extends java.util.Map.<br />
that's because railo's struct is optimized for the railo enviroment, it neeeds no interpetation, like a map in cfmx needs.<br />
why you access a struct via reflection (struct.get(key)) instead of native cf access (struct[key]), every refection access is 1000 times slower than a native access! reflection access on coldfusion object is always the worst decision.</p>
<p>on java level railo can't be 100% similar to cfmx, only cfmx can this.</p>
<p>what is exactly the problems with include?</p>
<p>greetings michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: barneyb</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/comment-page-1/#comment-94913</link>
		<dc:creator>barneyb</dc:creator>
		<pubDate>Sat, 07 Jun 2008 16:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=416#comment-94913</guid>
		<description>Dan,

I&#039;m not sure.  As it stands right now, it&#039;s a viable way to embed groovy right inside your apps.  As for turning it into an whole-app framework, I&#039;m not sure about that.  The real goal was to deal with some classloader issues so that I can use Groovy direct from the URL (via GroovyServlet), and built entire applications in Groovy with no CF dependencies.  CF could still be used for the views, of course, but that&#039;s a secondary decision.

For the direct embedding, it has some potential for storing groovy scripts in the DB and executing them dynamically for business rule configuration.  I.e. you can change certain business rules without having to change the CF code, you just update the Groovy script in the DB.  That sort of arrangement is difficult with CF (less so on BD), and the CF syntax is less friendly.  I&#039;ll probably end up using it for that in a couple apps.</description>
		<content:encoded><![CDATA[<p>Dan,</p>
<p>I'm not sure.  As it stands right now, it's a viable way to embed groovy right inside your apps.  As for turning it into an whole-app framework, I'm not sure about that.  The real goal was to deal with some classloader issues so that I can use Groovy direct from the URL (via GroovyServlet), and built entire applications in Groovy with no CF dependencies.  CF could still be used for the views, of course, but that's a secondary decision.</p>
<p>For the direct embedding, it has some potential for storing groovy scripts in the DB and executing them dynamically for business rule configuration.  I.e. you can change certain business rules without having to change the CF code, you just update the Groovy script in the DB.  That sort of arrangement is difficult with CF (less so on BD), and the CF syntax is less friendly.  I'll probably end up using it for that in a couple apps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Roberts</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/06/cf-groovy/comment-page-1/#comment-94879</link>
		<dc:creator>Dan Roberts</dc:creator>
		<pubDate>Sat, 07 Jun 2008 12:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=416#comment-94879</guid>
		<description>Very cool. Is this something that, given some more work, you plan to use for real projects?</description>
		<content:encoded><![CDATA[<p>Very cool. Is this something that, given some more work, you plan to use for real projects?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
