Patent madness

Software patents are causing a crazy situation where big companies patent the most stupid things.

Sun is seeking a patent on the company’s per-employee software pricing plan. It’d be interesting knowing who owns the per-company or per-computer princing patents.

Amazon.com has filed suit against Barnesandnoble.com, alleging that the rival book and music e-tailer illegally copied Amazon’s patented 1-Click technology. Has Microsoft patented the double click? Is that the reason why Bill Gates is the richest man all over the world?

The worst thing is that open source can have serious problems with patents.

Stop Software Patents in Europe!.




EuropeSwPatentFree

Multiple Message Resources in Struts

I’ve find a good example about using multiple message resources in Struts as if they were only one, this means that you don’t need to specify the bundle in each tag.

For those people out there that use JSTL+Struts, as I do, you know that message resources must be configurated in Struts config file besides JSTL config because Struts Validator needs it.

I’ve tidied up the code for using it in ONess, you can get it in the oness-common-webapp-controller (check ActionServlet and CustomMessageResources in the sources) and the configuration in oness-common-webapp-view, you need to change the action servlet in web.xml to use the customized one and in struts-config.xml specify the message resources separated by commas.

Now I need something similar to be used in JSTL, I think that Spring has some support for that.

The meaning of “eXtreme” in “eXtreme Programming”

A real extreme tool is Guantanamo by Aslak Hellesoy, it makes me understand the true meaning of “extreme” 😉

Do you have problems maintaining high test coverage? Send the untested code to Guantanamo!
Guantanamo is a tool that deletes all code lines that are not covered by tests. Guantanamo is part of the Extreme XP Tools family. Some thoughts about why it was created are written down here.

Maven OR Ant? Maven AND Ant?

There is too much controversy of moving from Ant to Maven, but maybe people don’t know that ant build scripts can be used with maven.

These are the step by step instructions:

  1. Create a minimal project.xml, that we’ll call POM (Project Object Model) or project descriptor. The most tedious task will be adding the dependencies needed to compile your classes, but you can use this search tool to get groupId and artifactId for them. If any of that dependencies are not at ibiblio repository copy the url of the repo, you’ll need it later. Change sourceDirectory to suit your needs.
    
    
        3
        yourgroup
        yourjar
        
            
            
                hibernate
                hibernate
                2.1.6
            
            
                springframework
                spring-core
                1.1
            
            
        
        
            src/java
        
    
    
  2. Create a file maven.xml. This is the place to write ant scripts. You just have to rename targets to goals. You can get the current dir using ${basedir}.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <project
      xmlns:j="jelly:core"
      xmlns:ant="jelly:ant"
      xmlns:maven="jelly:maven"
      xmlns:util="jelly:util">
      <goal name="doSomething">
        <!-- do some stuff using ant scripts -->
        <delete dir="${basedir}/adir"/>
        <mkdir dir="${basedir}/adir" />
        <copy todir="${basedir}/adir">
          <fileset dir="${basedir}/anotherdir"/>
        </copy>
      </goal>
    </project>
    
  3. If you use some dependency not at ibiblio create a project.properties file with a line maven.repo.remote=http://www.ibiblio.org/maven,http://cvs.apache.org/repository where http://cvs.apache.org/repository is the url you copied early. You can add as much urls as you want, separated by commas.
  4. Now you can run maven doSomething to execute the ant goal, and you can also call maven java:compile to compile the classes, maven site to generate a good looking website,…
  5. A common complain of Ant users is speed. You can call maven doSomething java:compile to run both goals or use maven console, where ypu can type any goal without the startup penalty time.
  6. Now you should be ready to check maven reference docs to explore the lots of features that maven can offer.

To sum up you can do with Maven everything you can do with Ant and many more things, so why don’t give it a try?