Integrating groovy and guara

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Integrating groovy and guara

Leandro Cruz
Hi all. I wrote a small and simple framework called guara (guara-framework.sf.net) and I would like to add native support for groovy on my project. For this, I ask you for guidance.

1) In guara I have a nice template engine which renders output using the file extension to select the underlying template engine technology. Right now velocity and freemarker and supported, both running at the same time :-)

I'd like to add support for groovy templates. What should I use? Groovlets or Groovy Templates?
Templates seems like the natural choice for me. The framework has a generic Context object which is used to bind java code an hmllike templates (velocity and freemarker)

2) We also have what we call Modules, which are java classes which a) back execution of templates, like .net code behind and b) execute business logic according to url params, like rails, turbine and struts.
Today these Modules must be implemented in java, but it would be nice to code them on groovy.
What should I use for this? GroovyClassLoader or GroovyScriptEngine?

Please, let me now about any issues or consideration you may think of.

Thanks

--
Leandro Rodrigo Saad Cruz
software developer - certified scrum master
:: scrum.com.br
:: db.apache.org/ojb
:: guara-framework.sf.net
:: xingu.sf.net
Reply | Threaded
Open this post in threaded view
|

Re: Integrating groovy and guara

Guillaume Laforge
Administrator
Hi Leandro,

On 9/10/06, Leandro Saad <[hidden email]> wrote:

> Hi all. I wrote a small and simple framework called guara
> (guara-framework.sf.net) and I would like to add native support for groovy
> on my project. For this, I ask you for guidance.
>
> 1) In guara I have a nice template engine which renders output using the
> file extension to select the underlying template engine technology. Right
> now velocity and freemarker and supported, both running at the same time :-)
>
> I'd like to add support for groovy templates. What should I use? Groovlets
> or Groovy Templates?
> Templates seems like the natural choice for me. The framework has a generic
> Context object which is used to bind java code an hmllike templates
> (velocity and freemarker)

I'd go with Groovy templates.
You can add stuff to the templates context certainly the same way
you're doing with FreeMarker and Velocity.

> 2) We also have what we call Modules, which are java classes which a) back
> execution of templates, like .net code behind and b) execute business logic
> according to url params, like rails, turbine and struts.
> Today these Modules must be implemented in java, but it would be nice to
> code them on groovy.
> What should I use for this? GroovyClassLoader or GroovyScriptEngine?

GroovyClassLoader is certainly the most flexible solution.
It's used in all the integration mechanisms.

> Please, let me now about any issues or consideration you may think of.
>
> Thanks
>
> --
> Leandro Rodrigo Saad Cruz
> software developer - certified scrum master
> :: scrum.com.br
> :: db.apache.org/ojb
> :: guara-framework.sf.net
> :: xingu.sf.net


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Integrating groovy and guara

Leandro Cruz
Thanks Guillaume,

I added support for Groovy templates on Guara last night. It was pretty easy and I was really happy with it. One thing I miss is a groovy template editor in eclipse.

Thanks for your feedback, specially regarding
GroovyClassLoader. The way I see it, one will be able to mix modules in Java and Groovy in guara.

Congratulations for the great work the groovy team did in the past to make it easy for us to integrate it into our products.

Cheers

--
Leandro Rodrigo Saad Cruz
software developer - certified scrum master
:: scrum.com.br
:: db.apache.org/ojb
:: guara-framework.sf.net
:: xingu.sf.net

On 9/10/06, Guillaume Laforge <[hidden email]> wrote:
Hi Leandro,

On 9/10/06, Leandro Saad <[hidden email]> wrote:

> Hi all. I wrote a small and simple framework called guara
> ( guara-framework.sf.net) and I would like to add native support for groovy
> on my project. For this, I ask you for guidance.
>
> 1) In guara I have a nice template engine which renders output using the
> file extension to select the underlying template engine technology. Right
> now velocity and freemarker and supported, both running at the same time :-)
>
> I'd like to add support for groovy templates. What should I use? Groovlets
> or Groovy Templates?
> Templates seems like the natural choice for me. The framework has a generic
> Context object which is used to bind java code an hmllike templates
> (velocity and freemarker)

I'd go with Groovy templates.
You can add stuff to the templates context certainly the same way
you're doing with FreeMarker and Velocity.

> 2) We also have what we call Modules, which are java classes which a) back
> execution of templates, like .net code behind and b) execute business logic
> according to url params, like rails, turbine and struts.
> Today these Modules must be implemented in java, but it would be nice to
> code them on groovy.
> What should I use for this? GroovyClassLoader or GroovyScriptEngine?

GroovyClassLoader is certainly the most flexible solution.
It's used in all the integration mechanisms.

> Please, let me now about any issues or consideration you may think of.
>
> Thanks
>
> --
> Leandro Rodrigo Saad Cruz
> software developer - certified scrum master
> :: scrum.com.br
> :: db.apache.org/ojb
> :: guara-framework.sf.net
> :: xingu.sf.net


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email