Nov 18 google for code

Personal 2 Comments »

Dain Sundstrom (of Geronimo) IM’d me about

Look at a view of an open source project


I like the “Labor cost to develop” tag :)


A piece of code.

Nov 17

Java 5 Annotations: The difference between wanting to see config in the code, or assign it

Java, Tech 3 Comments »

I have been talking to a lot of people about metadata annotations. Although I think they are very useful, I also worry about annotation hell (which I see in some .Net apps).

I think that some people get confused between:

  • “I wish I could see that a piece of configuration affected this class/method/field”
  • “I want to be able to assign some metadata on this class/method/field”

We see this a lot when people move into AOP. People get scared that they can’t SEE that a cross cutting concern module is affecting their code. Some tools help out here, and they are only getting better.

I think the key is that I want to modularize the concern in one place. I want it DRY. Then, if I need to change something, I can do so in that one place, rather than throughout the code (the whole point).

However, people tend to want to put @CrossCuttingConcern on all of the areas in the code to GET AROUND the problem that they aren’t using a tool that shows them, or allows them to configure something at that point.

I think it is going to be interesting to see us mature more, and have views in our code which come from external areas. I should be able to change a pointcut in one place, and have my source view change if it now applies to different places (ADJT in Eclipse).

So, I hope to not mistake the urge to be able to view things, with the ability to assign them in the place that makes sense.

Nov 16

Getting excited about Groovy again

Tech 1 Comment »

Although I am using Groovy and enjoying it, I will admit to being a bit worried about it.

It has fantastic potential, but I didn’t know if it would have the push to get there. It is always tough if you are developing open source without a company(ies) behind you.

The Groovy London Meetup has just finished (I wish I could have gotten over there), and I am really excited at what I see.

They have ironed out some of the wrinkles in the language, and should be set to use Janino and tools for the parser. Good error messages should be here.

The Java platform is a good one. Where I listen to Miguel talk about Mono and platform vs. language, it reasonates. We can have the same thing with Java. Groovy is just one of these languages, and we have a choice of the tool for the particular solution!

Let’s get Groovy and finish it up!

A few langauge changes

// these are all valid
def x = 1
String x = 1
def String x = 1
def x
String x

// however these are invalid declarations of a variable as it could be a typeo
x = 1

OR: Maybe the ‘any’ keyword will be chosen (my preference):

- defining intialized variables/fields:

String foo = “wombat”
Integer i = 45
any bar = “gizmo”

- defining methods:

void someMethod() { … }
any someOtherMethod() { … }
String someStringMethod() { … }

return is not optional UNLESS your block has only one expression

foo() {
println 5
+5 // compile error as this is a dumb expression }

would generate a compile error. It must be one of these instead…

foo() {
println 5+

foo() {
println 5 +5

foo() {
println 5
return +5

Nov 16

Miguel de Icaza ApacheCon Keynote

Tech 1 Comment »

I was just in the ApacheCon keynote with Miguel de Icaza. He walked through a history of his world, showing information on GNOME and Mono.

He went into some detail on the WHY certain decisions were made.

Although I don’t agree with everything he does (e.g. he prefers Linux over Mac OS X :) he was a fantastic personality.

It was so fresh to listen to a smart person speak VERY honestly. No corporate crap. Just feeling and passion.

I am a big fan of IKVM, and think it is very interesting that Java and .NET bytecode can be run in the same place. There is a lot of potential here.

I didn’t quite agree about the portability issues with Mono. I think that the majority of Microsofties are still using COM, and dink with the registry, etc etc…

Great stuff.

Nov 15

redirect: in Spring MVC

Tech 2 Comments »

With the new Spring 1.1.2 release, I can move an app away from CVS HEAD (I know. bad boy).

I was using the new redirect: notion in Spring MVC where I was able to change:

Get rid of the new RedirectView() so the Controller doesn’t even know that I am doing a redirect

return new ModelAndView(getSuccessView(), “id”, foo.getId());

Use the new redirect: syntax in my action-servlet.xml

<property name=”successView”><value>redirect:/listAuctions.html</value></property>

Set the redirectContextRelative attribute to true in my Velocty View Resolved (this is true by default)

<bean id=”viewResolver”
<property name=”exposeSpringMacroHelpers”><value>true</value></property>
<property name=”requestContextAttribute”><value>rc</value></property>
<property name=”redirectContextRelative”><value>true</value></property>
<property name=”cache”><value>true</value></property>
<property name=”prefix”><value>/WEB-INF/velocity/</value></property>
<property name=”suffix”><value>.vm</value></property>

Nov 15

Spring 1.1.2 Release

Tech No Comments »

Spring 1.1.2 has been released

Dear Spring community,

I’m pleased to announce that Spring 1.1.2 has just been released. This is a bugfix and minor enhancement release. Among the new features are:

* added support for multi-dimensional collections to BeanWrapperImpl (e.g. “map[myKey][0]” or “map[myKey][0].name”)
* added “getType(name)” method to BeanFactory interface, checking the type of object that “getBean” would return
* added “getBeansOfType(type)” convenience method to ListableBeanFactory interface, without explicit filters
* added PropertyPathFactoryBean, allowing to evaluate the property path of a target bean and expose the result
* allow “bean*” rather than “bean+” in XML bean definitions, i.e. no bean definitions in a file (just imports)

* AbstractApplicationContext automatically registers a context-aware ResourceArrayPropertyEditor for Resource arrays
* added GenericApplicationContext class, allowing for arbitrary definition formats (via a single internal BeanFactory)
* improved ResourceBundleMessageSource and ReloadableResourceBundleMessageSource implementations
* added “setText(plainText, htmlText)” method to MimeMessageHelper, for alternative texts in the same mail

* added “objectResult(collection,type)” and “intResult”/”longResult(collection)” convenience methods to DataAccessUtils
* added support for pre-bound Sessions (e.g. OpenSessionInViewFilter/Interceptor) with JTA and TransactionManagerLookup
* added “load(entity, id)” method to HibernateOperations and HibernateTemplate
* added “initialize” and “closeIterator” methods to HibernateOperations/Template, following “Hibernate.initialize/close”
* added “queryCacheRegion” property to HibernateTemplate, specifying the cache region used for queries

* added ServletContextResourcePatternResolver, to find matching resources within a web app even in an unexpanded WAR
* added “defaultStatusCode” property to SimpleMappingExceptionResolver, specifying the HTTP status code for error views
* UrlBasedViewResolver supports a “redirect:” prefix now, for convenient redirects through special view names
* added “springMessage”/”springMessageText” macros for Velocity and “message”/”messageText” macros for FreeMarker

For details, please have a look at the changelog.

Note that this Spring distribution comes with an updated HSQLDB version, namely Unfortunately, the HSQLDB 1.7.2 branch is incompatible with 1.7.1 in some areas. While all Spring sample apps have been adapted accordingly, please be aware that updating your own applications with the new hsqldb.jar requires your HSQLDB server to be updated too (i.e. both need to run version 1.7.2). Furthermore, watch out when running on JBoss <3.2.6, which ships with HSQLDB 1.7.1 in the server classpath.



I have run into a few problems with HSQLDB mismatches. It has sometimes gotten quite mystical on how the problems came about.

Nov 15

Brian gets Groovy at the Derby

Tech 2 Comments »

Brian McCallister got Groovy while in the Apache Derby tutorial at ApacheCon (I am at ApacheCon myself).

select count(*), groovyEval(’foo = ["woof", "meow"]; foo.join(” — “) ‘) from fortunes;
1 |2
13686 |woof — meow

1 row selected

Cool. It is interesting to think how the eval could dig in more

Nov 11

Transparent Inversion of Control

Tech 1 Comment »

Dave Thomas wrote a thoughtful entry on IoC and Ruby.

He takes a look at one of the IoC implementations available for Ruby, Needle.

One of the problems that Dave has with IoC is the “magic”:

One of the problems I have with the current IOC implementations is the “then a miracle happens” stuff. You

Nov 10

Apache Geronimo 1.0 M3 Released

Tech No Comments »

Congrats to the Apache Geronimo team.

They posted Milestone 3 of Geronimo 1.0.


  • CMP Entity beans are now supported. However, there are still significant limitations (no EJB QL support). This is one of the last outstanding core J2EE features.
  • Geronimo security realms have been integrated with the J2EE containers, so J2EE container-managed authentication works.
  • The web container now supports HTTPS with configurable SSL certificates, etc.
  • The transaction system is more robust, with bug fixes, transaction log support, etc.
  • An application client container is now included with Geronimo
  • Configuration changes to core Geronimo services and running applications are persisted, though we still lack a user-friendly interface for making such changes.
  • Manifest Class-Path entries in J2EE application modules are supported.
  • JDBC database pools and JMS connection factories, topics, and queues are now fully supported “out of the box”.
  • When deploying a J2EE connector, multiple instances of the same resource adapter can be declared in the same deployment plan.
  • The command-line deployment tool supports authentication and hot deployment to a running server.
  • JAX-RPC and SAAJ features are available to applications acting as Web Services clients (though Web Services server features are not yet available)

Also read:

Geronimo Roadmap

Download: zip, tar.gz

Release notes

Nov 10

Firefox 1.0: Congrats guys

Tech No Comments »

What a pleasure it is to be able to go into Help and see:


Congrats to the great Mozilla team. I had been dissapointed with Netscape 4, and thought we were destined to a world of IE.

Now there is a new player, and I am happy. I just have to wait for the great plugin writers to catch up with the latest release!