Wednesday, August 6, 2008

Boo on you Blogger

I'm getting annoyed by Blogger's limitations. I'm resurrecting my old domain name to blog using Wordpress: http://locnguyen.com/codr

Saturday, August 2, 2008

has_many :headaches, :through => multiple selects

Wow now I remember why I hate coding up the view whether it's Java or Ruby. I spent so much time trying to get this relationship to work on the front end. Sure there was a lot of information and docs but not enough examples. I guess that will be my next post: Many-to-many relationships and how they're represented in the erb view.

Tuesday, July 29, 2008

Hello out there...

Yikes! Blogger says the last post was February 25th. It's harder to maintain a technical blog than I thought :)

Since my last visit here, I've been focusing on Java things (yea, ew, I know) like getting deeper into Spring, Spring MVC, and Hibernate. Then when got sick of frameworks and went back to more wholesome things like design patterns, refactoring, and domain-driven design.

I'm back to messing around with Ruby now but more specifically, JRuby. Maybe I'll write about that. More to come later...

Monday, February 25, 2008

First Stab at Test Driven Development

I recently took advantage of a mandate to rip out the most complex part of my app and rebuild it from scratch. I had deep experience with the application already so this was much easier. The requirements were set in stone so I knew all the different unit tests I had to write. For a lot of reasons this functionality didn't get enough dev and test time during implementation and it came back to bite every few months. The defects were always corner cases too. Grr.

This time I created interfaces and stubbed out some classes. I knew what I needed to test for so I wrote JUnit tests before implementing the real deal.

As I was developing the new code, it was such an awesome experience to catch bugs minutes after they're introduced. A few days later when I finished rewriting the logic, I was pretty confident in what I had written. Every day the tests would run dozens of times. I've never had this much reassurance before...

Saturday, February 9, 2008

Setting up JRuby on Rails with PostgreSQL

After a long hiatus I've started reading again. Current topics of interest: Flex, Hibernate, and JRuby.

I ran into some problems getting a JRuby on Rails environment with PostgreSQL set up on my Mac. After reading some documentation I started over and installed the latest version of all the required gems. It's working like a charm and I can finally get into some code.

1) JRuby v1.1 RC1
2) activerecord v2.0.2
3) activerecord-jdbc-adapter v0.7.1
4) activerecord-jdbcpostgresql-adapter v0.7.1