Is Code Generator + Stored Procedures worse than O/R Mapping?

Excellent post about O/R Mapping and stored procedures. Paul writes, that there are two good approaches for development:

  1. O/R Mapping
  2. Stored Procedures (SP) + Code Generator (CG)

I agree. Other ways are not so good and bring additional problems (sometimes serious). Just one point is discussable for me. Paul puts O/R mapping on the first place, but I don’t think that CG+SP definitely worse than O/R Mapping. I have very bright example in our company. We’ve used CodeSmith, and this tool really great. Sure, templates took time, and I can’t insist that O/R Mapping will not solve the same problems faster next time. But, anyway, CG is a good alternative.

I personally prefer O/R Mapping. I have experience with NEO.NET and Tangram, and these tools are good and helpful. But there were some nasty problems with them, and (sadly) lack of documentation is very serious problem for many free open-source tools. It takes time to dig into source code and get the problem fixed. It takes time to understand system behavior, when it does not mach expectations. But these are problems of exact (free) tools, not an O/R Mapping in general.

NEO Impressions

We are using NEO in TargetProcess project. So far so good in general. Simple operations with database are really simple, code looks much more better, unit tests are clearer and faster to write. Yes, unit tests are really fast. NEO provides database abstraction in its core, and real database is not required for tests. I like that.

But there is one nasty bug I had not fixed yet. Sometimes NEO throws an exception when trying to cast objects. The problem is very strange in fact. I did not dig into details, maybe it can be fixed within reasonable time frame. Anyway, this bug worsens overall (good) impression.

XP Planning and Stephen Covey

Ron Jeffries did tried XP Planning for his own life management. Here what is he does. He creates big story cards like that:

House. This includes cleaning the basement, putting in the new kitchen,
improving the master bath, getting more storage for books and impedimenta,
general cleaning, doing something with the broken grill, …

Then breaks these big cards into several smaller and assigns some of them on short iterations. Pretty easy and similar with XP Planning practice.

I am reading excellent Stephen Covey’s book Seven Habits Of Highly Effective People. There are some parallels between Covey’s advises and Ron Jeffries’ approach. Covey wrote, that you should determine the most important things in your life and focus on them. You can write down them and then split them on smaller parts (big and small user stories in fact).

Then Covey gives an interesting advice about planning. You’d better use one week as a basic planning unit (like an iteration in XP?) for all important tasks in your life and track progress every weekend. A single day is a bad planning unit, since you will plan very strict and feel yourself under pressure. And the pressure will increase in the course of time. Single week gives more freedom.

So Stephen’s methodology for life management (the book was published in 1989!) is something like XP Planning for software development. It has three essential things:

  • Focus on important things
  • Small manageable chunks (features)
  • Small (weekly) iterations for better progress tracking

The question is… Can we consider life as a Project? 🙂