Skip to main content

Posts

Showing posts from 2007

My excuse for not blogging the last month

Recent activities eating away blog-activity include mostly JAFS - our annual internal weekend getaway. JAFS essentially means hauling our ~40 Java-programming colleagues off to a desolate hotel for a weekend, doing not so much else than having fun programming (and shooting some paintball).

The concept of the weekend's tasks are based on the following:
Divide the gang into 5 groups
Present some technologies that are core, meaning everyone of us should know by heart (for instance Spring and Maven)Present some new technologies that are hot, and might come in handy in the near future (for instance JRuby and OpenESB)Do some cool programming competition that makes use of above technologiesThese points demand a mass of preperations. We've been 5 people spending evenings and weekends planning the event for the last month.

First we spent a whole load of time settling on which tehcnologies to focus on. See we've got four different camps of technology groups in Objectware, each of which …

So you thought Spring's autowiring was a no-no?

Think again.

Yet another Spring 2.5 feature, the @Autowired annotation gives you back the control of autowiring, by-type mind. Back in Spring 2.0, autowiring was considered by many to be an anti-pattern due to the lack of control and overview of which beans would actually be injected at runtime. With annotation driven injection (meaning you've got in some Spring XML file), objects are only injected when you explicitly state so.

This allows you to reduce the amount of dependency mapping in your Spring XML config files and replace them with annotations in your Java files. If you've got multiple implementations that are possible autowiring candiates, you segment them by using the @Qualifier annotation.

Rather than riddle this blog post with snippets of Java and XML, I want you to get the Spring source (you can import it into Eclipse easily) and check out this test:

/spring/tiger/test/org/springframework/beans/factory/xml/QualifierAnnotationTests.java

I've been playing around with…

Spring TestContext Framework

I'm somewhat surprised that there hasn't been more noise around in the blogosphere about Spring 2.1's TestContext Framework. I had the pleasure of working with Juergen Hoeller for a day after JavaZone. Among other things, I learned about the fancy @Autowired annotation that you can use to make your autowiring much safer. Normally autowiring is considered bad practice, but it was Juergen's advice that now it is okay to use. This means in practice that all your service beans will still be declared in an applicationContext.xml file, but the dependencies and object graphs will be annotated in the Java files (or atleast where you see fit).

After this I had a deeper look into the features of Spring 2.1. Note the point about "our next-generation Spring TestContext Framework with support for JUnit4". Now this is cool.

Why we need it (or something like it)
For a long while I (and many of my colleagues and peers) have been annoyed by the disability to manage tests as the …

Post JavaZone 2007

In other news, this week I attended JavaZone 2007. Here's a wrap-up:

Wednesday

I was going to attend Stephan Janssen's talk on Web 2.5, but unfortunately the room was completely packed when I got there. So I headed over to Johannes' talk. Not surprisingly, his room was stuffed full as well (and appearantly he never got his projector working). So I ended up wandering into Kaare's talk on open source. As always Kaare delivers a quality talk (with cool slides!), but I can't help being slightly disappointed he chose a more exiting and technical subject.

I headed on to catch Craig McClanahan (hey, wasn't that hard to spell) and his talk on jMaki. It's not the first time I've been presented to it, got some of it on Jazoon. jMaki certainly is a platform to be reconed with for JavaScript developers, and I hope it (or something similar) will become a de facto standard for the range of JS-widget libraries appearing today.

Around then I discovered my phone had been co…

Continous web testing with Selenium, Maven and Continuum part 2

Update: Fixed camelCase in localRepository tag.

It's been a busy week, with JavaZone and some exiting things going on in my project at the same time.

I'll get straight to the point and post an exampe app that will solve the problems from the previous post.

I started off with a maven archetype create webapp.

I added configuration of the Jetty plugin (note that this isn't really necessary to get the rest working, but is handy for testing out the webapp with mvn jetty:run).

I put the web-test running in its own profile, so it won't be ran with each mvn install. This is to underline the fact that you probably don't want the web-tests to be run each time you build the app. Web tests take too much time and should be done by your CI system.

So, all the details of configuring maven for running Selenese tests are inside the with id "web-test". I've done a few other modifications as well, adding a couple of snapshot repos, and the web tests of course. I added …

Continous web testing with Selenium, Maven and Continuum

Wow, nearly a month without posting. I haven't really gotten any good excuses, just lack of stuff to write about, I guess. But for the last week I've been struggling and doing something I find really interesting and useful: Web-testing.

Regular readers will know about my love for Selenium. I still believe that Selenium is the way to go about web-testing.

So, the web application in a project was approaching web-test-worthiness quickly (well, actually it was about a month or two past the point where we should've started doing web-testing). Mind that we were already doing continous integration on the project, so it was only for the reason of not having core-developers breaking any of the stuff being out in the web.

Let me clarify a bit on that last point: Modern web frameworks expose core domain objects way out into the web (like the User.lastName property here in Matt Raible's example).

When core developers refactor Java classes - XML files, property files, JSP files and Jav…

What I did this weekend..

I'm just back from a great weekend in Tønsberg! We've got this inner circle in our Java department called (duh) Core Java, and every once in a while we pack up, head for some desolate place and nerd away for the entire weekend. This was another weekend like that (although Tønsberg is not as desolate as I had expected, more of a classic south-of-Norway town with great clubs and people). We stayed at the hotel by the water side, not the greatest view but good since I haven't been around the ocean half as much as I would've like this summer (bad weather in Norway this year).

So, we got checked in on friday and fiddled around with AOP, our man Sergei gave us a taste of what he's going to present at JavaZone this year. Don't miss it. After that we headed out for beer, gin and tonic.

Day two included a presentation of Spring's Java Config which was followed by an interesting discussion on Spring, Guice and testability of Java configured modules. We had a session o…

Learning the holy ways of consulting

You might've noticed another fall in the number of posts here lately, because yet again it is time for summer vacation. I've now been vacating for a week, and it feels like I've been away for a month. So, in order to keep my fingers warm, I'm semi-planning the arrangment for 9 new Java-developers we're receiving in the beginning of August.

The reason I dug into this job of training the newly recruited is obivously that I want to turn these new peeps into miniature versions of myself. They're (mostly) fresh out of university, are all smart and pleasant people (I met them on a couple of previous occasions), and seem like good potential mini-me's ;)

Jokes aside, I have a strong opinion on how new guys and gals should receive the most basic knowledge and in what order this should happen. Personally I was quite abrubtly launched onto a customer's site, but luckily I had a couple of years of experience in the right direction, so I already had basic stuff like a…

Jazoon 2007: Some more notes on last day

I'm just back from some dubbin' in Publin, I mean pubbin' in Dublin, so little time to write a full post. However, I did find the notes I lost from day 4 in Jazoon:

...

Last Day. Neil Gafter on closures.

First talk OSGi from Ergon Informatik.

The speaker is really happy with OSGi. It's great, it works really well, etc. Running osgi demo.

Bundles/plugins managed in a phone on a console app called J9 Console.

Goes on to talk about RCP. eSWT for embedded. Subset for SWT. Can run without RCP/osgi context if you don't need them.

JFace, gui toolkit. eJFace for embedded.

eWorkbench lets you bundle simul apps running. eUpdate is the update mechanism that is in eclipse. Pretty cool, the whole update manager is run on an embedded device.

Services can be shared between apps in the same VM.

Issues they have encountered in eRCP. Useful list.

Use JFace fonts and typesets to avoid memory leaks.

Some negative experiences.. Complex bundle dependencies. The services have states to manage, and t…

Jazoon 2007: Last day

I didn't really get around to take any notes the last day. Or well, I did take some notes but I lost them.. Here's what I attended at least:
Neil Gafter's keynote about closuresA slightly booring talk by Danny Coward on the future of JavaOSGi embedded <- good talk. Interesting topic, good speakers and demos Q & A about Web 3.0 with Henry Story <-good talkDiscussed Jackrabbit performance with David Nuescheler so I was late for the last, and most interesting talk of the day:The build-up of artificial complexity <-- good talkIn the last talk, I asked the speaker whether he thought extensions of Java as a platform was a fair way of increasing complexity vs new languages better fit for the job (a more powerful platform does reduce the need for new components), with a particular regard to AOP and Closures. He answered that AspectJ in runtime would be considered a foreign component increasing complexity quite a bit, but closures would be more of a welcome addition to…

Jazoon 2007: Day three

The last thing we attended yesterday was Neil Gafter's Java Quiz BOF. Will have to take a look at FindBugs.sf.net.

Keynote with Erich Gamma. Eclipse Jazz looks mightily impressive. It's an Eclipse workbench addon that integrates *a lot* of groupware functionality in Eclipse. Think task-tracker, project members, svn commits and activities, the quick tour made it look really impressive (live demo). Unfortunately, Jazz is a commercial product. And would you really pay for anything that is based on Eclipse (being the obtrusively bug-filled platform it is)?

First session. SAP talk. Memory is split in heap space (objects) and perm gen. Heap dump content, objects, classes, classloaders, GC. Currently alive in memory objects.

Retained size of an object is not the same as the shallow size. Retained size includes the underlying chars for Strings f.ex. Retained size can be calculated by simulating a GC and see what objects remains.

By looking at dominator trees (parenting objects and their …

Jazoon 2007: Magnolia product presentation

The chronology of this post isn't entirely correct, but I went to one product presentation last night, being Boris Kraft's Magnolia presentation. There weren't too many attendees (mostly likely because of late announcement), but it was still a nice presentation.

I spent a lot of time with Magnolia last year and the year before, and I have to say it is quite impressive to see how far they have come since Magnolia 2.0 in the recent 3.1 version. The user interface is much nicer, Document Management, lots of new paragraph types, workflow stuff, as well as a pretty slick site-designer for the enterprise version, just to mention a few new features.

And in my personal opinion, the price isn't bad compared to other proprietary CMS'es, and you still get a long way with the open source version. From a few years back their number of reference projects has been multiplied by the hundreds, and traffic on Magnolia-powered sites all in all is probably sky-high by now.

I've excha…

Jazoon 2007: End of day two

After lunch I dropped in on ØysteinGrøvlen's intro to JavaDB/Derby.

Supports some cool things I didn't know about, like support for external authentication mechanisms, encryption, calling java from SQL (for whatever reasons you want to do that for).

Different persistence mediums (file, jar, memory). Derby must be started as a networkServer in order for other applications to connect to it outside the runtime.

SQuirrel is a nice tool for browsing the db.

Had a quick talk with him afterwards on HSQL vs Derby in typically JUnit tests (like in a subclass of Spring'sAbstractTransactionalDataSourceSpringContextTests). HSQL is still faster, and in-memory implementation of Derby is still in the experimental phase. It can be tuned by turning off some logging, and doing setup in @BeforeClass (junit 4) should help.

...

David (Day) Nuescheler's talk on AJAX on top of JCR. At the same time as this was pushing their CRX content repothingie, it was actually quite a cool product. R-JAX is …

Jazoon 2007: Day two half done

Disclaimer: I'm just splashing in the notes I'm talking while listening to the talks here. All notes are not stated facts. Just stuff I manage to pick up.

Keynote by former Apache foundation chairman Roy T Fielding about the ideas and origin of REST, the re-discovery of REST (after SOA/SOAP). Fielding published the REST architecture in his dissertation 7 years ago, and advises us to be aware of buzz.

Second part of the keynote was an ELCA talk about integration between heterogenous systems and how Spring has helped them with that.. Very 2004'ish.

...

Glassfish V3 talk.

V1 was released at JavaOne last year. V2 is still in development (clustering, load balancing), most development will happen in V3. Lotsa changes going on.

It is essentially the same demo that was held at JavaOne some weeks ago.

Quickly in demo. Startup is in 800 ms and still able to serve static pages. Started off with deploying a RoR application.

asadmin deploy -- path ~/ror/mephisto

Deploying a RoR application sta…

Jazoon 2007: Afternoon and evening

Great, I managed to do a java Black Belt attempt on Java 5 and ended up with 0/5 points. I've never even heard of that Scanner class. Think I better get started on that certification (again).

...

Went to a talk by Red Hat's Jan Wildeboer. Virtualization. RH now delivers a full stack with JBoss server and clustering. Most OS'es are built being able to dynamically use CPU and memory (not Windows of course).

Some keywords: VMWare invented x86 virtualization. Hypervisor, ring zero. There were performance issues (20% with heavy io, which is especially overhead intensive). Now there is something called para-virtualization with minimal overhead (1 - 5 %).

Talking about perfomance, live migration, upgrades..

Jboss clustering is still the solution for scaling up memory exploit as the JVM is not dynamically using memory or CPUs.

Virtualization offers us a lot of better perfomance, especially as more CPU's and memory are fitted onto boards.

The talk was a bit out of my league, but it is…

Jazoon 2007: Day 1 Keynote

And we're off. I'm listening to the keynote session. Taking place in a movie theater, seems like the conference is taking place inside some cinema metroplex called Sihl-city, or Movie-City.

We weren't really aware of the size or scale of Jazoon up front. Seeing the amount of people in the theater, it's not too positively surprising. The theater is about 2/3rds full, I think I can count the number of attendees in the hundreds. There is an okay amount of stands, many of which are naturally Swiss companies that I've never heard of, and I'm guessing most of the attendees are Swiss as well. I've only counted 6 Norwegians so far, the three of us from Objectware included. The other three are from Sun, two of them are doing talks on JavaDB later on.

After some welcomes and intros there were some (dry) words from the sponsors, including Andreas Knöpfli, manager Sun, Switzerland, a guy from Elca, Swizz IT service company. Red Herring, some magazine. Farley Duvall is…

Arriving in Zurich (Jazoon 2007)

So after a slightly delayed flight and some easy public transportation, we've now arrived in Zurich. Jazoon starts tomorrow, and it seems like we've (accidently) managed to book ourselves into the same hotel as where the conference takes place (Sheraton). Sweet!

Unfortunately, our power-adapter won't fit the chargers of our laptops, so I've got approximately half an hour of battery time before I'm out. Will try to get a charger and post back frequently with reports on various talks through the week.

Give me a shout if there are any particular talks in the program you think I should attend! I haven't really had the chance to sort out the schedule.

Scrumming the night away

Today I decided to do a small experiment.

I was scribbling up a tiny todo-list when I thought "Hey, why don't I do some rough estimation on how long these things will take?". This is what the list looked like at first (at 18:00):
Short bike trip - done at 18:30Do some planning for Objectware-uni (training for the new folks) - done at 19:00
Fiddle with personal bank-stuff, bills, etc - done at 19:30Write this blog entry - done at 20:00Do some maintenance programming for a customer - done at 22:00So off I went on my little bike trip, trying out those new bike-shoes that click on to the pedals (did I mention that I cycle to work and I think everybody should do the same?). Naturally, I bumped into my neighbour that I had to help out with moving a fence, and neighbour-chat with for a while. By the time I got back it was 19:20.

Darn. So I had to re-arrange my estimate:
Bike and neighbour - done at 19:20Objectware-uni - done at 19:30 (would have to be quick!)Bank business - 20:00Blo…

Going to Switzerland/Jazoon!

Coming up, Jazoon, a four day conference filled with interesting talks on various Sun-self-bragging campaigns, Java 6 and 7 stuff, and some interesting things about JavaDB, Java Content Repository, scripting languages, etc.

Me and two colleagues from Objectware are heading down there on sunday the 24th of June. My first time in Switzerland, so it's definitely going to be a cool trip. And if I get some chance I'll drop by some old friends in Basel. Oh, speaking of which. You Jazoon guys might want to change the default Magnolia log-in on your website ;)

Regarding my JavaZone work, I'm not going to put too much effort into it before I know whether the abstact has been accepted. Will probably get feedback before the 20th of June.

That's all I have time for today! Need to get some sleep.

No blog today folks

Today I've been busy playing Starcraft against some old mates (we haven't played that stuff in like 7 years or something).

I did however get some feedback on my JavaZone abstract. Turns out I've been a bit too fluffy in the abstract, and I have until thursday to elaborate on some key points. Just to let you know I'm busy enough :)

The domain

Note: Blogger is probably gonna mess up the styles in this post pretty bad, so forgive me if I re-post a couple o' times. View the original post if the feed item is garbled.

I've figured I need to get rolling on the example/reference case for the Action Domain Object-talk.

After some long and hard pondering I drifted away from the insurance domain and into something far more web 2'ish: an online community site.

I'm gonna call it The Universe. It's pretty simple, facebook'ish application that includes Worlds, Groups, Rooms and People.



Some cases:

The Universe can crud (save, browse and delete) WorldsA World can crud Groups , Rooms and PeopleA Group/Room can add/remove People (members)(or a Person can join/part Rooms and Groups)A Person can send messages to People or RoomsA Room is like a chat-room, as opposed to Group which is a more permanent organization of PeopleThese 6 different entities are my Action Domain Objects.

It does have some complexing features, like a …

The academical approach

Oops, seems I to published this post prematurely by hitting some Blogger keyboard shortcut.

I've been sitting for some minutes trying to figure out how to approach the JavaZone talk mentioned in my previous blog-post.

Note that I have already submitted an abstract to the comittee, and that I won't publish the abstract here in the blog. Now of course the abstract is pretty detailed on what the talk is going to be about, but I've still got some elbow room on how to "implement" the talk.

I will use this blog as a tool to get my aim right on how to present the talk, what examples to include, what the slides should look like, and how to make it most straightforward and understandable for the audience.

Now in lack of having done any presentations at a larger conference before, I'm gonna dig into what I learned at the University, which wasn't very much, but they did teach me how to write a research paper, a skill which I will adapt into creating my talk:

The one rul…

The Blog that died and came back to life

A good month since my previous post. Apologies to those who've patiently been waiting for my weekly post. I've been busy sneaking agile into a project, running, cycling, doing two projects simultaneously, doing a Maven workshop (was going to write about that, but was too beat at the time), maintaining a wiki, writing an abstract for JavaZone, and having a real life at the same time.

In spite of having many things to do, things are going really great. The customer's project is really exciting, and I'm able to use some really modern, high quality frameworks, receiving experiences that I might be sharing at JavaZone this year.

Anyhow, this post announces a blog-ressurection. I'm getting back into the weekly cycle, at least till the summer, starting tomorrow. The red thread throughout the posts will be pointing towards my proposed JavaZone talk (atleast until it gets rejected :P ).

I'm gonna give an easy tease on what it's gonna be about: We've had Ruby on Rai…

How to sneak Agile into a project

Being a consultant, the opportunities I get to do project management are quite few. Still I believe many of our customers can benefit from the advantages of doing some sort of agile method. Come riding in on a white horse yelling "You are old fashioned in-effective conservatives wasting loads of effort on your specs and docs! You will go over budget if you do not join the society of Agile developers!" won't necessarily convince management that this is the way to go.

So I take some small steps to build a small proof-of-concept, merely by applying it to my own daily routine. Most developers who like to organize their own personal work in some fashion, be it writing stuff down in a notebook or filing issues in an issue tracker, will recognize these steps as mere common sense.

It can be handy to note that these routines could also be absorbed into the project on a higher level, and that is essentially when your project becomes agile.

Step 1: Ask people what they are doing and t…