EJB3 and Hibernate

Tonight at the Denver JUG the main topic was EJB3. While the spec isn't official just yet, it's as good as and people have started using it. The hibernate annotations developers, for example. I've been using these annotations for a while now on a couple of projects but I haven't really thought of them in the context of what's coming with EJB3. One of things coming is dependency injection from the EJB container. When the speaker mentioned this, it made much more sense of the dust up a few months back when the hibernate team started scrubbing references to IoC containers such as Spring from their website. Why bother with some other IoC when your parent (JBoss) is going to offer one. In one sense, this makes a little sense. On the other hand, EJB3's dependency injection doesn't really work outside the scope of the EJB classes. So if you want it for something that's not an EJB of one form or another, you're screwed.

I applaud the direction that EJB3 is taking: borrowing from RoR's example of convention over configuration, e.g. Having used that a fair bit with my Hibernate beans, I can say it's definitely a relief. The need for XML with EJB3 is almost nothing. The only XML the presenter used tonight was for the .par file (yes, another Blah ARchive) and that was for the datasource definition. It was about 7 or 8 lines. Nothing odious. A developer can use some XML to override the annotations at deployment time, if desired, but from how it appears, the XML is just about gone with EJB3.

EJB3 has some nice features that aren't really available in Hibernate, as far as I can tell, like extended transactions across calls for things like multiple step wizards. With the simple little example he went through tonight, EJB3 looks to be very very light indeed. The whole time I kept thinking, "These EntityBeans look like Hibernate POJOs." Which begs the question, "Why migrate to EJB3 if you're already using hibernate?"

And that's a fair question. There's not a lot of immediate value at first glance for sure. On the other hand, management of things like the SessionBeans and the like might be worth it. Integrated life cycle management from the container might be worth it. Overall, I didn't see a whole lot that says "Let's migrate!" However, EJB3 apps look more and more like how I've traditionally done Hibernate applications with some of the plumbing done for me. The one possible lack I see is the dependency injection being limited to EJBs only and no apparent way to plug in alternate implementations of those dependencies for testing. Have two DI mechanisms in place could get very messy, indeed. Perhaps the next version of the J2EE spec can address that. I haven't seen or used the new stuff enough to say whether that lack is real or perceived. Perhaps using the optional XML allows you to plug implementations. I'll have to wait and see.

Overall, I liked what I saw. EJBs certainly look a lot lighter than when I first saw 1.0 of the spec. And since EntityBeans are basically Hibernate POJOs (at least in JBoss' case), I'm halfway there.

The Doom movie

If you like the game, or if you just like a good action flick, go see the movie. The movie was great. There was a line by Karl Urban at the beginning that I kinda cringed at, but overall, it was a fantastic flick. The action was great. The suspense was nice. And it was true to the feel of the game (Doom3) if not the actual story line. But, let's face it. Who wants to see a movie version of the game's story line. We already know that story. But the basic elements of the story line was there. The Rock and Karl Urban did a great job. Though, to be honest, The Rock didn't start dropping the expletives where I thought a real special ops type of guy would have. Though, to be fair, he did light it up in places. I can tell I'm a parent of a small child, though. As an aside, don't take your kids to see this movie. Yeah, you may think your 8 year old is mature enough. He's not. You'll ruin the movie for yourself (if you have any soul anyway) and you'll ruin for everyone around you. And you'll probably traumatize your kid, you sick bastard. Anyway, back to my kid. When the guns started firing, I started reaching for the remote control to turn it down lest I wake the kid. Then I remembered that I left my little back at home and settled back down for some too loud action. A thoroughly enjoyable flick. I'll probably see it again. Made me wanna break out my xbox game...

ipod on Linux

Well I finally sat down to get my ipod syncing with linux. Using ipodslave and amarok, I can sync pretty easily. I can copy to the ipod and remove files fairly easily. I can't, apparently, update the tag information and affect the ipod database. And, files i copy over with amarok/ipodslave have strange names like kpod10580.mp3. I'd like to change that as that's completely useless unless i'm looking at the ipod itself. I'm going to try gtkpod but at least I have some level of syncing now.