Saturday, May 31, 2008

Agile is for developers?

tie-cba-L.jpg

Consultancies used to provide a service by managing the entire project so you didn’t have to do much. Now with Agile and Pair Programming the consulting firms can dupe clients into helping them make the sausage, provide little to no services, yet still charge insane rates.

-- Zed Shaw


Wednesday, May 28, 2008

Using Facelets along with JSP in a JSF application

I wanted to use Facelets for some pages in an existing JSP/JSF application.
To achieve this I had to perform the following steps:

  • Download Facelets and copy the jsf-facelets.jar into your WEB-INF/lib directory
    If you use maven you can include the following dependency in your pom:
            <dependency>
                <groupId>com.sun.facelets</groupId>
                <artifactId>jsf-facelets</artifactId>
                <version>1.1.14</version>
            </dependency>
  • Add the FaceletViewHandler to the faces-config.xml file.
    <application>
        ...
        <view-handler>
            com.sun.facelets.FaceletViewHandler
        </view-handler>
    </application>
  • Define which pages should be handled by Facelets, i.e. urls ending with '.xhtml'. Add the following snippet to your web.xml:
        <context-param> 
                <param-name>facelets.VIEW_MAPPINGS</param-name> 
                <param-value>*.xhtml</param-value> 
        </context-param>
  • For a useful debug-screen, you should also add the following snippet to your web.xml:
        <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>true</param-value>
        </context-param>
  • Useful maven commands

    To skip tests, you can set the property maven.test.skip=true, i.e:
    mvn -Dmaven.test.skip=true package


    To list all the dependencies of your project, you can use the dependency plugin, i.e:
    mvn dependency:tree


    To build a web-site with a lot of information about your project, you can use the site plugin, i.e:
    mvn site

    This generates a directory 'site' inside your 'target'.

    Impressions from Zühlke Camp

    I spend a week in the middle of nowhere with my teammates from work.
    www.flickr.com

    Tuesday, May 27, 2008

    Using Facelets with Apache MyFaces Tomahawk

    Probably the easiest way to use Facelets with Apache MyFaces Tomahawk is using the tomahawk-facelets project.

    Installing the library into your local maven repository is easy:

    mvn install:install-file -Dfile=tomahawk-facelets.jar -DgroupId=com.google.code.tomahawk -DartifactId=tomahawk-facelets -Dversion=1.1.6.2 -Dpackaging=jar -DgeneratePom=true

    Then you can use it in your pom:
    <dependency>
        <groupId>com.google.code.tomahawk</groupId>
        <artifactId>tomahawk-facelets</artifactId>
        <version>1.1.6.2</version>
    </dependency>

    Directory Deployment in Glassfish

    Directory deployment can help you to improve your productivity when developing web-applications with GlassFish.

    Instead of deploying a packaged archive (.war) you can point GlassFish to a directory and let it pick up and deploy the application from there.

    You can do this by using the command asadmin deploydir path_to_app_dir.

    This has the following benefits:
  • You don't have to assemble the archive-package. That's one step less in the build-process.
  • Changes to your web-sources (JSPs, facelets...) are picked up immediately. There is no need for redeployment! This can be a huge producivity-boost!
  • According to this dcumentation, it should also be possible to dynamically reload the whole application (not only your web-sources)... but for some reason this didn't work for me...


  • The directory you point GlassFish to should have the following structure:

    –|myproj
    –|–|web-sources (JSPs, facelets, css ... subdirectories are possible)
    –|–|...
    –|–|–|WEB-INF
    –|–|–|–lib
    –|–|–|–classes
    –|–|–|–web.xml
    –|–|.reload

    The trick is to configure your IDE/Environment, so that you can work directly on the above structure...

    By touching '.reload', you can force the application to be redeployed.

    Sunday, May 25, 2008

    IntelliJ IDEA Caret Placement

    One of the most annoying behaviors in IntelliJ IDEA is the placement of the caret in the text editor. When you click in the editor, the cursor is paced exactly at the position where you pointed the mouse, even if there is no text anywhere nearby!
    I cant see the benefit or a sensible use-case for this behavior...

    Picture 2.png


    In every other graphical text editor I know of, the cursor jumps to the end of the text on the respective line.

    Now I finally found the setting that lets IntelliJ behave like the other text editors I know:
    Under Settings->Editor->Behavior switch off "Allow placement of caret after end of line" (in the box "Virtual Space").

    Picture 1.png


    I think this should be the default , new users probably expect this behavior.

    Thursday, May 22, 2008

    Hofstadter's Law

    parenthetical_exclamation.jpg

    It always takes longer than you expect, even when you take Hofstadter's Law into account.

    -- Hofstadter's Law

    Friday, May 16, 2008

    Realityloop?

    MoebiusAntsSmall.gif Last week, I was a the SET 2008.

    One particularly funny tidbit was the close occurrence of the following two quotes.


    In a panel discussion about 'software engineering tomorrow' a sarcastic comment about the failed CASE hype in the 80ies was made. Allegedly, the promise of some tool-vendor was:
    You don't have to program any more! Just fill in the method-bodies.

    The whole audience was laughing...


    A bit earlier this day, there was a session about 'Event Driven Architecture'. Basically this was a product presentation of BEA Event Server and its application in a real-world scenario. At the end one of the speaker proudly declared:
    Because of our framework we do almost no programming any more! All we do, is a lot of scripting and configuration.

    This time the audience was expected to be impressed ...

    Thursday, May 15, 2008

    Where are the ruby jobs?

    In my current job I get in touch with a lot of heavy-weight (if not obese!) Java projects.

    Not being overly happy with those kind of projects (along with them comes usually legacy and overhead of all kinds, out-dated technology ... and little fun), I am wondering if there are any alternatives in enterprise application development.

    In my current naive view, Ruby could be such an alternative. Ruby On Rails as a prototype of lightweight web development appears fresh and sexy. It is still a playground for alpha-geeks, but ready for the enterprise at the same time.
    Not beeing mainstream means that it can attract new and innovative but not dead-critical projects. Where you can achieve a lot with little overhead... thats where the fun lies!

    According to indeed.com there should be a real demand for Ruby programmers.


    Compared to Java and .NET:


    But this trend seems not to be reflected here in Switzerland:

  • Search for 'ruby' yields 3 hits on monster.ch.
  • The same search on hays.ch yields 5 hits, but none of them in Switzerland.
  • Searches for 'rails', 'groovy' or 'seam' have less or even no hits...

  • It seems I have to keep looking ...

    Wednesday, May 14, 2008

    Leap into your sources

    Leap seems to be quite an interesting product. It aims to be an alternative to the Finder in Mac OS X.

    Leap implements some advanced and interesting UI-concepts. Especially the "Go Deep"-mode combined with filtering allows interesting usages.
    Picture 1.png

    In combination with Quick Look, Leap can really be helpful.
    Especially when browsing through java projects with their nested directory structure Leap can help you avoid to step up and down the directory ladder i.e. when looking at a domain object and a related service.

    Leap offers a lot of other features (like tagging), but I have not yet found the way to using them efficiently ...

    But I have not yet decided if it is really worth it's price for me ...

    Friday, May 9, 2008

    Web Framework Trolling

    trolls.jpg
    Trolling with Java Web Frameworks...
    It can't reach Language Wars, but still very funny...

    Monday, May 5, 2008

    What is your point?

    abstraction3.GIF

    One thing business people are not good at is abstraction.

    --Eric Evans, InfoQ

    Friday, May 2, 2008

    Modern Art: Do you get it?

    I stumbled over this intriguing setup... which is art?  ... which is more confusing?
    Related Posts Plugin for WordPress, Blogger...