Apr 22, 2007

NFJS: Tapestry 5, and Other Hot Topics

I attended No Fluff Just Stuff here in Portland this weekend. My favourite speakers were definitely Jared and Glenn. In terms of technologies I came away inspired to learn JavaScript and Tapestry. Other hot tips for further investigation are:

* Parallels (doesn't work out of the box in Ubuntu 7.04)
* Guice
* Pragmatic Programmer Book Beta
* JSUnit + Rhino
* Sin
* Objective Camel
* Haskell / Erlang / Scala
* Tiddlywiki

Apr 20, 2007

Ubuntu is Here!

Yes! You've been waiting with baited breath. Now it's here! 7.04 is out featuring "... stunning new desktop effects are available as a technology preview for users who choose to enable them."

Edit: I'm getting really slow downloads from the main site. You might want to try this instead:
http://releases.ubuntu.com/7.04/ubuntu-7.04-desktop-i386.iso.torrent

Apr 18, 2007

Retro-Fitting Maven2 to Projects with Tests and Source in the Same Folder

Setting the scene: You have an existing project with a single src directory that contains both your source and your test code. What you want is for Maven to exclude tests from any built artifacts and be able to run the tests in the src directory.

What to do: Edit your pom.xml to set the source and test-source directories, plus specify the pattern used by your test classes:

  <build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>src</testSourceDirectory>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
<testIncludes>
<include>**/*Test.java</include>
</testIncludes>
</configuration>
</plugin>
</plugins>
</build>

Retro-Fitting Maven2 to Flat Projects in CVS

Setting the scene: So you have two projects A and B both in CVS, and project B dependes on project A. What you want is to use Maven to manage your dependencies and create your IDE project files for you. On top of that you want project B to refer to project A's eclipse project, not it's jar in the Maven repository.

What to do: So for this you're going to need to maintain a flat project layout - otherwise using the CVS plugin gets messy.

You're going to have three projects in your workspace: projectA, projectB, and parentProject. The parentProject is needed so that projectA and projectB can be considered related modules.

Your parentProject/pom.xml needs to look like this:

<project>
<modelVersion>4.0.0</modelVersion>
<groupId>myGroup</groupId>
<artifactId>parentProject</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- common dependencies go here -->
</dependencies>
<modules>
<module>../projectA</module>
<module>../projectB</module>
</modules>
</project>
projectA/pom.xml needs to look like this:

<project>
<parent>
<artifactId>myGroup</artifactId>
<groupId>parentProject</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- snip -->
</project>
projectB/pom.xml needs to look like this:

<project>
<parent>
<artifactId>myGroup</artifactId>
<groupId>parentProject</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- snip -->
<dependencies>
<!-- snip -->
<dependency>
<groupId>myGroup</groupId>
<artifactId>projectA</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<!-- snip -->
</project>


You can now run mvn eclipse:eclipse from the parentProject directory to create Eclipse IDE project files for all modules.

Apr 13, 2007

Web Development Tools

Here's a new suite of Firefox plug-ins that I'm getting started with:

Live HTTP Headers
FireBug
Selenium IDE
Web Developer

I haven't used them much yet, but FireBug is looking pretty sweet. I like that the documentation for it is so accessible.

Apr 9, 2007

Developer Motivation: Local vs Global Optimisation

Ok, now this is just getting too interesting. To what extent do you feel a developer should be thinking in terms of the business's bottom line? Opinions differ. Weigh in here: http://curious-attempt-bunny.blogspot.com/2007/04/what-makes-good-team-member.html

Beyond Technical Skills

How often is it actually about the technical skills? Anyway, that's yet another interesting event that I just can't attent (weddings, tsk). This one's hosted by Esther Derby which is enough for me to be confident that it'll be very rewarding. If you do go, try and remember to get back to me with what you thought about it.

Apr 8, 2007

What Makes a Good Team Member?

To my mind a good team member interacts comfortably and constructively with everyone else on the team. Esther's recent post on When is it time to move someone off the team? elaborates on this, giving examples of team members that don't fit. Technical competence aside, each one of Esther's points comes down to what extent they share the team's perspective. Interesting. I'd also naively assume that if someone works well in the team then it will more or less continue to be the case, whereas the tone of Esther's post implies that a slow divergence is common enough.

Apr 7, 2007

Relocating Your Company? Here's Where Developers Prefer to Work:

Bart Skondin has results for his Work Location Preference survey of the PJUG list subscribers. It appears that as soon as a company is SW of Portland the interest from applicants drops off sharply:

"In order of weighted preference, desired locations indicated by (27) PJUG responders are:

02.21 Downtown Portland
02.91 SE Portland
04.04 NE Portland
06.13 Beaverton
07.37 Hillsboro
07.02 Tigard
07.75 Milwaukie
08.06 Wilsonville
08.06 Gresham
08.44 NW Portland
08.64 Vancouver
18.00 SW Portland
40.50 Cornelius
40.50 Lake Oswego"

Apr 3, 2007

Deeper into Grails

Ok. First a few helpful links for setting up an IDE, installing the groovy plugin, a good cheat sheet, and the grail user list.

Working with Grails is generally pretty smooth - once you absorb the fact you need to hit refresh in your browser after changing a page that is. I don't like having to restart grails (it just takes seconds out of my day) and I'm trying to minimise doing so. One inescapable reason for restarting is after a model change - fair enough. But what's this about problems running grails generate-all? With grails 0.4.2 I get:

New Controller added. Restarting Grails context: /adbo
Closing application context [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext;hashCode=9318677]
Closing Hibernate SessionFactory
Premature end of file.

Forum posts indicate that the next version of grails fixes this issue, and that I should switch to an installation from subversion. Well, that's what I'm about to do right now..

Edit: Yep. Smooth transition form 0.4.2 to 0.5-SNAPSHOT. Seems you can't move your project back to 0.4.2 too easily if you want to though:
merlyn@tesuji:~/workspace_grails/adbo$ grails run-app
Welcome to Grails 0.5-SNAPSHOT - http://grails.org/
...
Application is pre-Grails 0.5, please run: grails upgrade

Still, you can't find fault here:
merlyn@tesuji:~/workspace_grails/adbo$ grails upgrade
NOTE: Your application currently expects grails version [pre-0.5], this task will upgrade it to Grails 0.5-SNAPSHOT

WARNING: This task will upgrade an older Grails application to 0.5-SNAPSHOT.
However, tag libraries provided by earlier versions of Grails found in grails-app/taglib will be removed.
The task will not, however, delete tag libraries developed by yourself.
Are you sure you want to continue?
(y,n)


I'm still impressed.

Edit: Well. Upgrading to 0.5-SNAPSHOT didn't do it for me:
Web Context changed. Reloading...
New Controller added. Restarting Grails context: /adbo
Closing application context [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext;hashCode=23297349]
Closing Hibernate SessionFactory
Premature end of file.


although the (a)ll option is nice to see:
Generating list view for domain class [Contact]
File ./grails-app/views/contact/list.gsp already exists. Overwrite?y,n,a

Grails Jumpstart

I'm having a go at using Grails for a website related to my wedding. I had a few hiccups getting started with the setup. Despite that I got a lot done in very little time. Not too shabby.

I'm developing my grails app on my main PC and I'm hosting the app on my humble 1 Ghz box. These are the critical steps I took along the way:

  • I got setup with a dyndns account and installed ddclient (the apt setup of ddclient is a dream).
  • I deployed tomcat on my box, creating myself an admin & manager user. Smooth sailing so far.
  • I setup port forwarding on my router. This takes far too long. Darn sluggish router.
  • I created a skeleton grails app. Super fast: grails create-app
  • I created a war for deploying to tomcat. Also super easy: grails war (note that this defaults to creating a production war, you should use grails dev war if this isn't what you want)
  • I manually deployed to tomcat via scp – anyone know a cleaner, grails-esque, way of doing this?
  • It works! (Two caveats: 1. the first time I deployed I got a JVM SIGSEGV towards the end of the grails war startup. 2. Things are also not too fast. My 1 Ghz 686 takes two minutes to deploy the war for my skeleton app)
  • I setup a virtual host for my particular dyndns account so that I can play around with multiple apps and make it harder for nasty people to hack poor tomcat. This was done easily enough:
    • I created TOMCAT/webapp-virtual
    • I added <Host name=”myaddress.dyndns.org” appBase=”webapp-virtual”> <Context path=”” docBase=”myapp”/><Host> before </Engine> at the bottom of TOMCAT/conf/server.xml.
  • I stopped the clock (so as to keep to my fiancee-timebox-promise) – 35 minutes. Still enough time to write this up.
Reactions
Pretty sweet. Some things are a little rough around the edges – e.g. my book said I shoudl use grails create-webtest which fails with an unhelpful “Script CreateWebtest not found.” A quick web search suggest I use grails generate-webtest. Still though, for a 0.4 release it's in great shape.