| Author |
why groovy? or when will developer use it?
|
Peter Primrose
Ranch Hand
Joined: Sep 10, 2004
Posts: 755
|
|
Hi Guys,
I can't ignore the buzz that Groovy receives; I'm a struts developer and wonder how can Groovy help me? can I integrate Groovy with my 'actions' or can I build a model with Groovy and integrate it with my application?
Basically, I would like to know why developers will use Groovy if they're already proficient with Java, I'd appreciate if anyone can give a concrete example.
Thank you
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
|
---
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
Hi Peter,
i'am a beginner with Groovy and i found the enhancement of Java IO quite convicing
Compare this to how you usually open, read and print out a file in Java.
Here are 2 more examples with Groovy File IO
Of course there are much much more features that make coding groovier
cb
|
 |
Peter Primrose
Ranch Hand
Joined: Sep 10, 2004
Posts: 755
|
|
mm...ok, I downloaded it to my eclipse and played for a while. I'm still debating as per the usage.
thanks Chris for the input
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
I hate the File IO groovy example. See why here:
http://www.greggbolinger.com/blog/2009/03/26/1238072820000.html
|
 |
Rj Salicco
Greenhorn
Joined: Apr 14, 2009
Posts: 17
|
|
Peter,
With JSR 223, Java has support for executing scripts (like Groovy) inside of your Java class files. So in your case, you can have actions that make calls to execute static Groovy scripts that can help your application be more dynamic at run-time. These scripts can live in a database or on a file system and can be updated while your Struts Web app is still running. You will see your changes the next time the script is executed. Maybe you want to change some validations, business rules, event notifications?
If you are familiar with Spring, you can check out Spring 2.0's support for dynamic languages (JRuby, Groovy, Beanshell). I think from this perspective, you can look into Groovy to come up with solutions that makes your life easier.
|
-RJ
http://www.rjsalicco.com
|
 |
 |
|
|
subject: why groovy? or when will developer use it?
|
|
|