I have just started learning Groovy few days back.The first thing that I have asked myself and searched for is 'Why should i use groovy over java and When I can use Groovy. ?'
I am following the book 'Programming Groovy'. The things I have understood regarding 'Why' part are
(more...)
Filed under Groovy, Java | 15 Comments »
A short while ago, a collegue and I decided to write an application with Grails and Eclipse RCP. We choose Grails for the ease of development, and Eclipse RCP (in favor of Flex and Plain Old HTML) because we wanted to give our users a solid and native look and feel, for which Eclipse RCP works really well.
Since the Eclipse RCP front-end would actually be a remote front-end, we needed some kind of kind of communication between the client and the server. One of our first idea's was to use XML-RPC, which is pretty well supported in Grails, but it would force us to to do some mapping between our domain and the XML. Since we wanted to use the same domain classes is Eclipse as in Grails (by exporting the Grails domain to external domain jars), we opted for a different approach: Burlap/Hessian.
Tags: burlap, Grails, Groovy, hessian, httpinvoker
Filed under Grails, Groovy, Java | 7 Comments »
What if you're working with Maven, where you've got all your dependencies nicely organised, and now you decide to use any other piece of 'classpath-aware' software, like Fitnesse. The chances are that you'll need to use the same classpath in Fitnesse as in Maven. A possible solution could be to maintain it by hand, but why not write a very small script for it to do it for you? My (very very very!) basic solution is to use a Groovy, because it's easy to write, easy to read, and easy to use!
(more...)
After my first real encounter with Groovy I got really excited about it and decided to spend some of my personal training days to get more experience with Groovy. As study material I read the Programming Groovy book. While reading I really wanted to get my hands dirty, so as a study case I decided to solve one of my longest and biggest frustrations as a developer and that is working behind a proxy server. The idea I had is to create a groovy program that will allow to turn the proxy settings on or off for applications like (Maven, Subversion, Internet Explorer, Firefox and so on) by running a single command: groovy com/xebia/proxy/SwitchProxy on/off. Here is a short summary of some of the techniques I used while creating this program.
Filed under Groovy, Java, Testing | 2 Comments »
A thing I was playing with today was many-to-many relationships in Grails to create a Tag Cloud. To create a Tag Cloud, I must have a set of key/value pairs, each with a label and a value of the label, which could look like this:
['Java': 5, 'Grails': 16, 'Groovy': 12]
But to query this, I need to query a many to many relationship and produce the above result. This blog will describe how to do this with HQL, Criteria and the HibernateCriteriaBuilder.
(more...)
Filed under Grails, Groovy, Hibernate, Java | 6 Comments »
For my current assignment I need to write a script that basically does the following: open war file, download and add files from internet, remove files, change xml and property files, re-package war file.
In pure Java, this would be quite some work to implement. Of course there are several libraries available that will make unzipping, downloading etc a bit easier. But still it would be too much effort for such trivial tasks.
Since it is in fact a script I want to create, why not use a scripting language like Groovy. After two days of coding I must say am very happy with the progress I made given the fact that it is actually my first real Groovy programming experience.
Here are some experiences and code I created so far:
(more...)
Filed under Groovy, IntelliJ, Java | 8 Comments »
Today was the third day of the conference. Another couple of hours to go and then it is all over again. The fatigue is kicking in, and we're starting to run on reserve power. The topics of today included:
Today was the second day of the JavaOne 2008. Besides doing a lot of chatting in the JavaOne pavillion, and visiting all the cool parties this night, we also went to a number of sessions. Also today the NLJug had the James Gosling meeting we won for being the biggest JUG out here. After a long day of work, we finally had time to relax at the Adobe party and at the SDN party.
Todays topics included:
Currenttly, I'm in the process of building a Grails application. While I've built several prototypes/quick hacks, this is actually the first 'real' application I'm building. "So", I thought, "if this is a real application, I'm in need of some real tests!". When you're in the normal flow of developing a Grails application, everything goes so fast, you almost forget about writing the tests. So I decided to do it a bit differently, and do it just like in Java: do it TDD!
(more...)
The biggest Java event of the year is coming up again, the JavaOne. For me this is a place of inspiration. Seeing the newest technologies in action and talking to some of the great minds in the Java world, how can one not become inspired!
(more...)
Filed under Grails, Groovy, Java, JavaOne | 2 Comments »