Mar
23
2010
thorque
The newest release is available. This release is mainly a bugfix release. There are 2 new features:
- Filter internal stacktraces
- Importing GMaven projects
You can read here the New and Noteworthy. If you like you are be able to update your Eclipse installation with this update site: http://dist.springsource.org/release/GRECLIPSE/e3.5/
no comments | tags: Eclipse, Groovy | posted in News
Mar
23
2010
thorque
At EclipseCon 2010 the Groovy Eclipse Plugin wins the award for the Best Open Source Developer Tool.
This is very nice since the version 2.0.1 offers much of the features you know from the Java Editor:
- Syntax Highlighting
- Code Completion
- Refactoring
- Navigation
- Compile as you type
- and much more…
If you are interested and understand the german language you can read my article about the Groovy Eclipse Plugin published at Jaxenter.
no comments | tags: Eclipse, Groovy | posted in News
Aug
31
2009
thorque
Both operators are implemented in Groovy to shorten the code.
The Elvis Operator shorten your if-conditions. You know the common ternary expression:
def gender = user.male ? "male": "female"
This you can shorten with the Elvis operator:
def gender = user.male ?: "female"
Only if the expression evaluates to false or null the default value (here: female) will be used.
The other operator is the Safe-Navigation Operator. If you are working with Java Beans and their getter methods you have often a chain of calls:
customer.getAddress().getCity();
This works fine until one of the getters return null. Then you get a NullPointerException. To avoid this you can surround this call with a try-catch block:
try{
customer.getAddress().getCity();
}catch (NullPointerException npe){
//what can I do here???
}
This are at least 5 lines of code for catching the NullPointerException. But what can you do with this exception? Commonly you do nothing. You can log this or redirect this exception to the next tier. In Groovy there is the Safe-Navigation Operator:
customer?.address?.city
At first in Groovy you can use the properties instead of accessing the getter methods. The ?. operator checks if the expression on the left hand is null. If true the complete expession evaluates to null.
For this both operators there is an proposal for a change in the Java Programming language. For now this proposal is not accepted…but we hope so
no comments | tags: Groovy, Java 7 | posted in News
Jun
25
2009
thorque
The slides from the Groovy and Grails conference in May 2009 are available on Slideshare:
http://www.slideshare.net/gr8conf/presentations
Enjoy
no comments | tags: Grails, Groovy | posted in News
Mar
29
2008
thorque
The Spring-Framework is a non-invasive framework. This means you can develop pure POJOs without any dependencies to the framework. You don’t need implement any interface nor you need to extend any base classes. However there are a lot of useful classes and interfaces provided by Spring – do you know the HibernateTemplate? – so you can use them if you want but you aren’t forced to use them.
If you remember the Spring 1.x stream without use of these templates make it very difficult to implement DAOs. This is much better with Spring 2 and JPA. For now you need only to inject an EntityManager and use the methods of them. That’s very nice, because of the EntityManager is a class out of the JPA/EJB3 standard.
Since Spring 2 there are annotation support. Not only standardized annotations are supported. Spring provides his own annotations. This is not so nice, because the use of this annotations makes your PoJos depend on Spring.
Continue reading
1 comment | tags: Annotation, Groovy, Java, JPA, Spring | posted in Articles, News