Skip to main content

Tripping on Convention over Configuration

It is with dismay that I sometimes find the trend of moving traditional configuration heavy programming models to convention based troubling. Case in point - I've been trying to adopt the newfangled Spring Data based repository framework. It's been working wonders and I got the QueryDSL support and naming convention based query generation going.

After creating a bunch of these repositories, I ran into an issue with one of my custom repositories. It was not recognizing that a method in the custom repo is part of the custom side and not to be a candidate method for spring to do its voodoo magic. For some reason Spring thought the method is a property of the entity bound to the repository. After digging through the Spring code base and spending a lot of time, it finally was clear why this was happening: I had made a typo on the repository naming and the "y" was missing from custom RepositoryImpl class. If only Spring was smart enough to tell me that this is what was causing the problem instead of point to a confusing message. So long type safety and compile-type checking, and welcome to the brave new world of magic based frameworks! 

Comments

Popular posts from this blog

Automate SQL Dumps for SQLServer

The backup mechanism in SQL Server may be fine for many cases, but there are limitations with it (like restoring to a different server). I really like how I can just dump the database SQL with mySQL which can be easily processed with custom scripts. I was looking around for a mysqldump equivalent for SQLServer. I know you can do this with the SQL Management Studio through GUI in 2008 version, but I need this to be automated. This lead me to discover the SQL Server Management API . With it, you can do a SQL Dump like: using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Sdk.Sfc; namespace SQLGenerator { class Program { static void Main(string[] args) { //Connect to the local, default instance of SQL Server. { Server myServer = new Server(args[0]); Database db = default(Database); db = myServer.Databases["be"]; ...

Eclipse issues with JDK 1.6 update 21

A lot of users seem to be having issues running Eclipse with the latest update of Java from Sun/Oracle. Apparently they changes the metadata in the dll that shows Oracle instead of Sun. Here are the details and workarounds to fix it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514

Blame it on the Genes

I was just randomly watching a PBS Nova show today Ah ha.. that figures. When I was growing up, my parents had a big issue with me for now eating enough greens. For me, I just could not stand certain green vegetables for their bitter taste but my dad loved eating those - and forcing me to like them too. How I wish I could have told them to blame it on the genes!