Friday, June 27, 2008

Human Space Invaders

Today I implemented Space-Invaders running in the browser. But this implementation is much cooler:

Sunday, June 22, 2008

Redeploying cactus tests in JBoss

I am experimenting with Cactus in JBoss AS.
(I am using Cactus 1.8.0 and JBoss 4.2.2.GA)

According to the Cactus documentation, there are two ways to deploy your cactus tests:
  • Deploy the cactus jars globaly in your application server and deploy your derived ServletTestCase-Tests with your application.
  • Deploy the cactus jars together with your application.

  • (this documentation refers to tomcat deployment ...)

    I tried to go with the first method, but it didn't work:
    After the first deployment everything ran fine, triggering the ServletTestRunner resulted in a nice report showing the test results.
    But then I changed my tests, redeployed the application and hit the ServletTestRunner again... but nothing changed. The resulting report was still showing the results of the previous deployment.

    When I restarted JBoss, the actual report was shown. But redeploying the app did not update the report.

    So I changed to method two from above and removed the cactus jars from the global JBoss libraries and packaged them into my app (that's what the cactify-ant-task is for anyway).
    After that everything was fine. Redeploying the app resulted in a up-to-date report when hitting the ServletTestRunner.

    My guess is, that the result of the ServletTestRunner is cached if this servlet is deployed globally...?

    Probably there is another way to solve the problem while having the cactus jars deployed globally, but the solution works for my needs...

    The only resource I found on the net was this.

    Friday, June 20, 2008

    Frameworks: Responsibility Traps

    falle_2.jpg

    Responsibility trap number one: Building a platform to make other (lesser) programmers more productive.

    -- Eric Evans, SET 2008

    This seems to be a frequent scenario in many companies:

    The best programmers are fully occupied with technical details and are allowed to totally ignore the business problems at hand. The less skilled/experienced/passionate developers then are tasked to solve the business problems while forced in a straight-jacked by an ivory-tower-framework...

    I blogged about this before.

    Jeremy Miller has his own opinion about this:
    Making development "safe" for lesser skilled developers by taking choices away from developers [...] does far more to hamper the efforts of your best developers than it does to make weaker developers more productive.
    I'll say that there is a silver bullet(s), it's: Skill. Knowledge. Experience. Passion. Discipline.

    Thursday, June 19, 2008

    Teamwork

    Teamwork.gif

    Any five top notch programmers can be kept busy by one bad programmer.

    -- Eric Evans, SET 2008

    Later on he corrected his statement:
    In a team of five programmers the top three are always busy to observe and correct the work of the worst one. The only one productive is the second worst programmer.

    Hmm... do you feel productive?

    Sunday, June 15, 2008

    Listen to Rocky!


    pacman.jpg

    The thing is, early in my career I did Fortran... whether you call them services or procedures, it's the same thing!
    Been there, done that! I don't really feel the need to go back to passing a bunch of dumb parameter data into a procedure that we now call a service.

    -- Rocky Lhotka,
    Hanselminutes 105


    Episode 105 of Hanselminutes "Rocky Lhotka on Data Access Mania, LINQ and CSLA.NET" is very interesting.

    Some observations from my part:

  • Even experts like Scott Hanselman and Rocky Lhotka have not a consistent idea of Model-View-Controller (MVC).
  • The old topic of moving data from the database through the businesslayer into the view is a never-ending story. Also Scott and Rocky can give their five cent but no general solution. (Do you pass your business-objects to the view or do you transform them? Are entities business-objects?...)
  • I am amazed of how ignorant people are of Domain Driven Design and smart domain models. Scott seems to imply, that smart business objects are good for small systems, but don't work for big SOA-Systems...
  • Rocky talks about Responsibility Driven Design. Probably he refers to the Class-Responsibility-Collaboration technique. As this technique encourages real OO-Designs, he seems to pursue the same goals as Domain Driven Design...
  • Friday, June 13, 2008

    The Internet ... somebody takes care!

    Today I had an encounter of the third kind! I touched with the grey eminence that is behind the internet! I knew they were out there...

    Don't ask, I will not tell you the url :-P

    fff.jpg

    I try to imagine those specialists, fully aware of the responsibility to bring the most important service back to the world. Probably they are part of the secret special unit called 'Turbo Cycle Patrol'.

    Thursday, June 12, 2008

    Don't worry...

    STARTUP.jpg

    There isn't an Internet company in the world that's going to fail because of mistakes -- Internet companies make thousands of mistakes every week.

    -- Candice Carpenter of iVillage

    Wednesday, June 11, 2008

    News from the Palahniuk fandom

    Chuck Palahniuk just keeps going and going...

    I bought his latest piece two days ago:

    4130Y0ojDYL._SL500_AA240_.jpg

    ... and I am looking forward to reading it. Although critics on Amazon seem not to be the best... maybe he has played his trick too many times...

    Just out of curiosity I went to YouTube... and was surprised what I found:



    The man is just unique... I can't decide if I should find this funny or just strange ...
    If you can make up your mind: Part 2 and Part 3


    But there is more! Choke is coming o the Movies! I hope they will show it here in Switzerland... I can't wait!



    Here is the imdb-page for Choke.

    Still not enough? Invisible Monsters (probably my favorite of his books) is also turned into a movie... I already fear a disappointment!

    And there are some great tributes to the books on YouTube: Birds Ate My Face, Invisible Monster Credits, SURVIVOR, Lullaby Teaser...

    Tuesday, June 10, 2008

    When maven starts to pay off...

    I have an existing maven project. For QA I have to document it. Maven is a big help here: I just included the following snippet in my pom.xml:

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <sourcepath>src-gen;src/main/java</sourcepath>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.4.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <targetJdk>1.5</targetJdk>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    Then run mvn site ...

    ... and you get the following useful reports:

    image

    Friday, June 6, 2008

    Hibernate Annotations: what they don't tell you about mapping a package

    I just spent some time setting up a project using hibernate-annotations.

    In the reference documentation you find the following example for hibernate.cfg.xml:

    <hibernate-configuration>
        <session-factory>
                <mapping package="test.animals"/>
                <mapping class="test.Flight"/>
                <mapping class="test.Sky"/>
                <mapping class="test.Person"/>
                <mapping class="test.animals.Dog"/>
                <mapping resource="test/animals/orm.xml"/>
         </session-factory>
    </hibernate-configuration>
    

    What they don't tell you is what the element <mapping package="test.animals"/> means...

    Intuitively I would expect, that any annotated class in the given package is picked up automatically by the session factory, so that you can save the work of explicitly enlisting them.

    But this is not the case! And I could not find any clear documentation why...

    I only found the following clues:

    • According to this documentation, a package can be annotated. I never heard of this. It seems that you have to place the annotations in a file called package-info.java.
      Here is an example, using annotated packages.
    • According to the api documentation of the class AnnotationConfiguration, the method addPackage 'reads package level metadata'.

    So I guess the element <mapping package="test.animals"/> picks up any annotation-configuration that's available on the given package. But it does not pick up any configuration of the classes in the package...

    This is still a speculation on my part, but I think I am not the only one tripping over this ...

    Thursday, June 5, 2008

    Striving for professionalism?

    professional.jpg

    I don't think you can count someone even as a semi-decent java dev until he wrote his very own web framework at least once in his life.

    -- comment on this
    blog post


    Related Posts Plugin for WordPress, Blogger...