Professional

Funny framework code

I just found code like this in a (quite expensive) Java framework i was evaluating (Note: I edited the API Documentation and the name of the method):

    /**
     * Used to set some value and change some behaviour based on this
     * value.
     * API users should not call this method with {@code false}.
     * Instead you should invoke 
     * {@link #anotherMethodThatDoesTheOpposite()}.
     *
     * @param b   {@code true} to do something (false does nothing)
     */
    public void setSomeValue(boolean b) {
        /* here is some code that does something if b is true */
    }

Nice, isn't it? A method with a boolean parameter which must be true.

Weblogic Generics Bug

Yesterday we were trying to deploy an EJB application to Weblogic 10.3, but the deployment stopped with an IOException in the JDT compiler. No additional information was in any log file. After searching for some time, we found out that you can configure Weblogic to use Javac instead of JDT (somewhere in the EJB settings in the management console), which gave us much more details with the compiler error.

We reproduced the problem with a simple test EJB:

A base interface for all our EJBs

public interface BaseInterface {
    void doSomething(T t, U u);
}

A common abstract base class:

public abstract class AbstractBase implements BaseInterface {
}

The local interface for the bean:

public interface Test extends Base {
}

The bean itself:

@Session
public class TestBean extends AbstractBase implements Test {
    @Override
    public void doSomething(String t, Integer u) {
    }
}

The weblogic code generator generates a class with extends TestBean and has the following methods:

    public void doSomething(String t, Integer u)
    public void doSomething(Object t, Object u)

The EJB above runs in OpenEJB, and IMHO it is a valid session bean.. This seems to be a bug in the code generator, which is really holding us back since the abstract base class for some of our EJBs would make our life easier.

Agile Methods (JUG-ERN)

Last thursday, on June 10th, I gave a talk about agile methods at the meeting of the Java User Group Erlangen-Nürnberg together with Oliver Szymanski. You can download the slides here (the slides are in German).

We played the "60 Paces"-game with our audience, which was pretty cool. I never did this before, and the results were amazing - at least IMHO. After that we talked about some general problems in software development, and how "agile" tries to solve them. This was neither an overview nor a details-talk, but it included elements of both types. It also was by no means complete.

Anyway, I think (or should I say "hope"? ;) ) the audience liked it. There were a lot of questions at the end, and I think this is a positive sign. At least we gave them enough information to ask questions ;)

Wegner's Lemma (Note to self)

"It is impossible to fully specify or test an interactive system designed to respond to external inputs" --Peter Wegner

This is a strong argument for agile development for two reasons:

  1. It is impossible to fully specify the software we build. This means it is necessary to build it in small, incremental steps to ensure we build the right thing.
  2. It is impossible to fully specify the software process we use to develop, so why bother using a heavyweight process like RUP or V-Model? Better use a process which was designed to respond to change (and change itself when necessary), like Scrum or XP

I've got to use this as an argument against the V-Model style process I'm in right now in one of our next meetings...

ShortNotes for Android

ShortNotes for Android can now be downloaded from the android market. There is a free version and a "Pro" version (€ 1.49) which has some additional features.

Developers testing their own code.

"Asking developers to test their own code is like asking children to clean up their room" - I read that a couple of days ago and immediately thought "But what if you tell your children that they don't have to clean their room when they make some mess - that someone else would do it for them?" That would probably be a lot worse than asking them to clean their room. It might be hard to convince them to do it, but it would definitely be worth it. So this argument is fundamentally flawed.

I tried to find it on the internet, but found something else: "RT @rmaclean: Asking developers to test their own code, is like asking your child to mark their own homework. Suddenly you surrounded by geniuses!" The problem with this is that the very assumption, that testing your own code is like marking your own homework, is wrong.

Marking the homework is more like the product owner accepting the results of a sprint (or whatever activity translates to this in a non-scrum environment), and you would never let a developer do this. Testing your own code is like double checking the results of your homework before handing it in, and this is a very good idea.

Now, even in agile projects, a lot of people agree that it is necessary to have dedicated testers on the team. Can we find an equivalent to that in the homework example? Yes, it is like a parent checking the results of the homework before the child hands it in.

Should developers test their own code? They definitely should! Should they be the only ones who test their code? Probably not. But when there are dedicated testers the developers should get immediate feedback from them. An easy way to achieve this is to have the testers always work on the same features as the developers, not in a separate testing phase after development.

Android ported to the iPhone

It seems like android has been ported to the iPhone - and it's dual boot. This is nice - although there is definitely better hardware to run android on than an iPhone...

JSXP 1.0rc Released

JSXP 1.0rc is now available for download. It includes bugfixes and minor improvements and a lot of java doc. The official release announcement can be found here.

Slides Mathema Campus 2010

I have just finished all the slides for the Mathema Campus 2010 and the Mobile Developer Day 2010 in Erlangen, Germany. All the slides are in German.

Update 2010-03-18: I have uploaded the eclipse project we developed during the tutorial: MDD.zip. It is basically the app you would get if you implemented all the steps from the demo PDFs above.

YAML with tabs

I know, YAML with tabs does not exist. But: I indent everything with tabs, and I am always annoyed when I open YAML files and they use spaces for indentation. So here it is: tjyaml - YAML with tabs for Java. It is just a fork of jyaml, which uses tabs when creating yaml files and allows them when reading. The rule how tabs are processed is simple: One tab is one indentation.

Syndicate content