Any likelehood of a Cold Fusion Groovy Grails version?

38 views
Skip to first unread message

Jeremy Flowers

unread,
Mar 5, 2009, 7:42:11 AM3/5/09
to ColdSpring-Users
Hi.
I can across your website yesterday and was wondering if anyone had
contemplated creating a synergy between ColdFusion and Groovy or
Grails. or even the plausability of this.
I say this because Groovy/Grails has sort of made AOP within Spring
redundant because od the way closures can accomodate the same result.
Any thoughts?

Tony Nelson

unread,
Mar 5, 2009, 10:42:41 AM3/5/09
to ColdSpring-Users
You mean like CFGroovy? http://www.barneyb.com/barneyblog/projects/cfgroovy/

On Mar 5, 6:42 am, Jeremy Flowers <Jeremy_G_Flow...@yahoo.co.uk>
wrote:

Brian Kotek

unread,
Mar 5, 2009, 10:50:53 AM3/5/09
to coldspri...@googlegroups.com
To be honest I'm not sure what you're really asking about (a "synergy between ColdFusion and Groovy" is kind of vague?).

If you mean making it possible to leverage Groovy classes along with CFCs from a CFML application through ColdSpring, this has already been done. At Broadchoice, we have an HTML UI that uses Model-Glue and ColdSpring, which in turn uses a Groovy-based service layer and Groovy domain objects as it's model. The same Groovy service layer and domain objects are also used as the back end of a full Adobe AIR UI.

I know Joe Rinehart (who wrote the original adapter that allows ColdSpring to use a Spring application context as it's parent bean factory) is working on a project called Hoagie which will integrate a lot of these things together, and plans to release that ColdSpring adapter or have it incorporated into the ColdSpring core.

There is also Barney's CFGroovy project, that I haven't had a chance to play with it beyond some tinkering, so I'm not sure if or how ColdSpring or Spring fit into that. As far as I know he hasn't tried to pull Spring into that mix yet.

Jeremy Flowers

unread,
Mar 5, 2009, 1:28:35 PM3/5/09
to ColdSpring-Users
I was specifically thing of the way Grails defines interceptors to
achieve the same effects as AOP/Pointcuts etc without the need for any
complicated XML as you'd do with classic Spring.

For example:
def beforeInterceptor = {
log.trace("Executing action $actionName with params $params")
}

This is how Graeme Rocher defines advice in a Grails Controller in The
Definitive Guide to Grails 2nd ed.

Grails is founded upon Spring and Hibernate but, it takes advantage of
Groovy and it's closure capabilities to create a DSL that reduces the
complexity of the code a developer needs to contend with.

My question was could you leverage this and combine it with Cold
Fusion?
I admit to being totally new to Cold Fusion/ColdSpring.
But I know Spring quite well and how to do AOP with Spring up to
v2.5.
Sorry if this quesion may be slightly naive.

Brian Kotek

unread,
Mar 5, 2009, 1:35:57 PM3/5/09
to coldspri...@googlegroups.com
If I understand you correctly, the answer is unfortunately no. Since you can't define methods at runtime in memory like you can in Groovy, that won't work.

Brian Kotek

unread,
Mar 5, 2009, 1:39:49 PM3/5/09
to coldspri...@googlegroups.com
On a side note, I haven't messed much with Grails, but even in raw Groovy, it's metaprogramming and mocking capabilities are really slick (for AOP functionality as well as lots of other stuff).

Barney Boisvert

unread,
Mar 5, 2009, 1:51:12 PM3/5/09
to coldspri...@googlegroups.com
Grails is incredibly static. So I bet the AOP stuff is actually
converted to Spring pointcuts, either as part of compilation, or at
least as part of configuring the ApplicationContext. I.e. it's
probably not any more dynamic that what ColdSpring does, and possibly
less dynamic.

cheers,
barneyb
--
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/

denstar

unread,
Mar 5, 2009, 5:46:33 PM3/5/09
to coldspri...@googlegroups.com
On Thu, Mar 5, 2009 at 11:51 AM, Barney Boisvert wrote:
>
> Grails is incredibly static.  So I bet the AOP stuff is actually
> converted to Spring pointcuts, either as part of compilation, or at
> least as part of configuring the ApplicationContext.  I.e. it's
> probably not any more dynamic that what ColdSpring does, and possibly
> less dynamic.

I think the stuff he's talking about is really part of Groovy, not
grails (could be totally wrong, of course). Groovy is pretty freaking
dynamic. :-)

Re: http://www.infoq.com/articles/aop-with-groovy

And as for the XML config of Spring beans, this is pretty tits:

http://www.grails.org/Spring+Bean+Builder

As for Grails / CF... well, I actually dicked around with the idea of
loading up grails (I think it's basically a spring application
context) in CF, but...

What's the point?

Grails has a swell rendering engine (.gsp's), makes tests for you,
etc., etc., etc..

FWIW, serving grails from CF looks totally possible-- the reason I was
wanting to do it was for GORM (I dig the way constraints and whatnot
are set up, but there are pluses and minuses to the approach), but
then I was thinking..

"Ya know, you could add the GORM-ish stuff to Reactor pretty easily
(or really whatever you'd like, as CF is pretty freaking dynamic
itself), and that way it would all be in CF, editable by CFers, etc.."

Eh. Another FWIW: custom tags seem to offer some of the aspects of
closures, tho not as flexible as what I think I see in Groovy...

Double eh. The way CF handles functions and whatnot means that
theoretically, you can do some pretty AOP-ish stuff right in CF...
but, again, I think the main deal here is... well, a good pattern so
things aren't super hard for the next dev to figure out + scale well
(or a similar thought-path-- just because you can do it, is it the
best approach? etc.).

I mention this stuff because it seems like you don't see many people
doing things like dynamically renaming origFunction to _origFunction,
and replacing it with the modified version (that maybe calls
_origFunction), tho it's totally doable.

Tripple eh. I'm snarfing down some noodles while doing some other
stuff, so sorry for the sadly disjointed post, but maybe there's some
info in here.

Peace and potatoes peoples! =]

:DeN*

--
Guys just don't care. We don't take the time to plan behind each
other's back. We just say, If you don't like me, screw you'. If a guy
doesn't like you, you know because you have a black eye.
Jonathan Bennett

Sean Corfield

unread,
Mar 5, 2009, 7:45:27 PM3/5/09
to coldspri...@googlegroups.com
On Thu, Mar 5, 2009 at 10:28 AM, Jeremy Flowers
<Jeremy_G...@yahoo.co.uk> wrote:
> I was specifically thing of the way Grails defines interceptors to
> achieve the same effects as AOP/Pointcuts etc without the need for any
> complicated XML as you'd do with classic Spring.
>
> For example:
> def beforeInterceptor = {
>  log.trace("Executing action $actionName with params $params")
> }
>
> This is how Graeme Rocher defines advice in a Grails Controller in The
> Definitive Guide to Grails 2nd ed.

That's more about how Grails handles controllers (and the support
Groovy has for closures of course) so you may find it more appropriate
to look at MVC frameworks for ColdFusion rather than expecting
ColdSpring to handle this. You might start by looking at ColdBox which
has the concept of interceptors...
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Matt Woodward

unread,
Mar 5, 2009, 11:20:43 PM3/5/09
to ColdSpring-Users
On Mar 5, 4:45 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> You might start by looking at ColdBox which
> has the concept of interceptors...

Mach-II has plugins which function in a similar fashion.
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/wiki/IntroToPlugins
Reply all
Reply to author
Forward
0 new messages