Categories, Yeah!

Feb 10, 2011 18:03 · 436 words · 3 minutes read Meta Lift

Update (7th August 2017): This and other articles are kept for reference, however these days cold pragmatism has replaced the hacker mentality: The overhead of maintaining a custom blog engine - especially given the many breaking changes in Scala over the years - has led me to migrate the blog to a static Blog made with HUGO. The JDBC Wrapper mentioned below was never released as an Open Source Project, however if you are looking for an amazing library to work with databases on the JVM I strongly recommend JOOQ these days - no need to roll your own wrapper anymore or use a clumsy ORM.

Now all posts in my blog are properly sorted into categories. Implementing that feature has been a lot of fun, using Lift+Scala sped up things tremendously. I can only recommend Lift to anyone starting a new web project. Basically the whole work on the blog engine itself was done in half a day. No fiddling with annoying XML config to add new snippets, no stupid template language, I just wrote a bit of plain Scala code, some XHTML and BAM! it worked. Sweet :)

Also my home-brew database Framework (well, rather a slim JDBC wrapper for Scala) did work out well. While I am a big fan of Lift, I ditched Mapper a while ago for my own Blackjack DB (to be released “When it’s done.” ™).

Mapper is a pretty good ORM library. But I just don’t like ORM libraries. I found Mapper to be just too intrusive on my code. Also I often found myself in a situation where I exactly knew the SQL I needed, exactly knew the way I wanted to write my objects but then spend too much time to find a way to recreate what I had in mind in Mapper. I just don’t understand why I should learn a new API (and depending on the ORM tool, even a new query language) to write SQL. There is a great language for writing SQL — it’s called SQL. Why have your statements autocreated by a tool, when it is faster (and if you are experienced enough: creates better results) just to write them yourself?

Well, it is probably down a lot to personal taste, but I found that writing my own SQL and just using my own little wrapper around JDBC let me develop faster and with better results than using Mapper (or any other ORM for that matter — don’t get me started on Hibernate, that useless, stinking, annoying, bloated piece of … but I digress.)

Anyway, I hope you like the improvements!