Life Codecs @ NamingCrisis.net

Ruminations. Reflections. Refractions. Code.

May 21, 2009 - software dev

Hitler’s attempt at Agile Development

My friend Tom – who does not have a web presence unfortunately (hint hint, Tom) – sent this video link. It is one of the funniest things I’ve seen in a while, top-grade geek humour :-). Note the last sentence in the video. Classic!

Disclaimer: In case this gives the wrong impression – I am a fan of Agile methods, the emphasis on getting quality, well-tested code up and running is breath of fresh air; it takes a certain amount of discipline and culture though – the latter being more crucial in my view, and not always available. Humour like this really brings that much-spoken-about Real World™ to light :P.

May 3, 2009 - arts

“Visions”, an album by Ade ISHS

Disclaimer: I know Ade personally. Though I can’t handle crappy/mediocre music, from friends or foes!

“Visions” is Ade’s first solo album. Ade’s an independent musician based in Melbourne, Australia. The album is a collection of 9 beautifully composed piano pieces. My personal favourites are “Birth of Love”, “Sky” especially the second half of the composition, and “Rain 1”. The pieces are pleasant, relaxing, ambient but non-intrusive, and at times very inspiring (for one thing it digs out my wish to learn a musical instrument every now and then!). On average, each piece runs for about 7 minutes, and it is easy to sense the effort and love that has gone into the album’s creation. Note that although this is his first solo, Ade is by no means new to the music scene, having been involved in various events previously.

I highly recommend “Visions” if you like instrumental music. You can find out more about Ade and “Visions” at Ade’s website. In the spirit of fair use, trust, and freedom of platform choice (yay!) – Ade’s made sure the music is DRM-free.

Finally, only peripheral to this – but nevertheless quite interesting to geekoids and musicians alike – is that Ade’s Computer Science PhD is on Music Information Retrieval – so yeah, he likes his music :-).

Apr 27, 2009 - poetry

Bad Browser Haiku

Yes, I have nothing better to do. Enjoy the following haiku, which is potentially a pseudo-ku (not to be confused with Sudoku – gosh I am funny :P!), though I tried to stick to the rules and spirit of it.

1
2
3
Fox on fire, why, how.
Script gone rogue, Face... book, so cold.
Kill... the tab. Okay.

Yes, poetry is like code, and vice versa ;-).

Apr 25, 2009 - software dev

Spring 2.5 + EJB 3 Integration

Yes, yet another post on the topic so talked about on the Web (like a year ago or so anyway!). This is mostly for my benefit and summary though – haven’t even written code to test it myself, but here goes. Spent a few hours exploring integration alternatives just now, basically EJB 3 DI is great, but a glaring thing that’s missing is injecting POJOs into it, which Spring does quite well – sure in both cases the “POJOs” are managed by containers, but hey, nothing’s perfect, yet. To summarise, here are the 2 major integration scenarios and solutions:

  1. To inject Spring Beans into EJBs (and bootstrap Spring app context(s) from within EJBs!) is simple enough, we use:

    Spring Docs, Chapter 18, EJB 3 Integration

    This actually handles bootstrapping (read up the doc on how it does it), which is tricky in EJB modules, since there’s no standard EJB context listener mechanism as there is for web containers. Many app server vendors do have EJB module lifecycle hooks/interfaces you can implement – but obviously they’re proprietary and make your app less portable, so I’d rather avoid them if I can, I still don’t see why this feature isn’t part of the spec… clearly there are use cases, and clearly since there are non-standard implementations, it’s feasible to do and define behavior for.

    • The other way around is a bit tricky, i.e. we now need EJB container-managed objects (e.g. entity managers, EBJs, resources, etc.) injected into Spring Beans in the XML file. In this case those resources need to be registered in the JNDI ENC (still figuring out EJB context vs. global) and in the Spring XML a JNDI lookup is done for the name it was registered with, and then injected to the relevant bean via a bean-ref. A ‘lookup-then-inject’ Spring XML config example can be seen here (note dataSource JNDI look-up and inject):

      Spring and JNDI (Tomcat or Jetty)

      Registering the container-managed objects in the JNDI can be done via EJB 3 interceptors, for example, a use case is having Spring-managed DAO beans, but EJB-managed Entities/Persistence Units: let the interceptor have an annotation

      @PersistenceUnit(unitName="bar", name=”barEntityManagerFactory”)

      – which receives the container-injected persistence unit and then registers it into the JNDI registry keyed by the name “barEntityManagerFactory”. The Spring XML config will need a bean created through a JNDI look-up of “barEntityManager”, and inject that in to the DAO Spring-managed bean.

      Lots of repetition up there! (Note I said it was for my benefit :P).

Now I can finally watch some Naruto!