Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,130 | Comments: 45,560

filter by tags archive

Using Active Record to write less code

time to read 1 min | 199 words

The presentations from Oredev are now available, and among them is my talk about Active Record.

You can watch it here, the blurb is:

What would you say if I told you that you can stop writing data access code in .Net? Aren't you tired of writing the same thing over and over again, opening connection, querying the database, figuring out what to return, getting back untype data that you need to start putting on the form? Do you really see some value in writing yet another UPDATE statement?The Active Record framework allows you to fully utilize the power of the database, but without the back breaking work that it used to take. Active Record uses .Net objects to relieve you from the repeating task of persistence. Those objects are schema aware and can persist and load themselves without you needing to write a single line of SQL. Building business application using Active Record is a pleasure, the database stuff just happens, and you are free to implement the business functionality.

To be frank, I consider this to be one of the best presentations that I gave. Everything just ticked.


Aaron Erickson

Are not available, or are now available?

Kyle Szklenski

I think instead of "not" you meant "now". :)

Ayende Rahien

Yeah, probably one of my most common typos

Krzysztof Kozmic

This video is Public

Using Active Record to write less code

Ayende Rahien, We!, Israel

Isn't this description like... not very up to date?

Anyway, thanks. This only makes me regret that organizers of CodeFest turned out to be asses, and I didn't get a chance to listen to you live.

Some other time.

Lucio Assis

Awww, no pretty.png ;-)


Fun presentation, thanks


What's the performance of Castle ActiveRecord like? Is there much of a difference between it and NHibernate? Obviously it will be less efficient than NHibernate alone since it's built on top of it but how big is the gap?


Do you plan on releasing a new version of ActiveRecord soon? One that binds to NH 2.1 and fixes bugs like discriminators not being filtered with a HasMany.

"Release early, release often" as the Google mantra goes

Ayende Rahien


I have never been able to measure the difference.



Krzysztof Kozmic

Just seen it. indeed great presentation.

"Give me a model to work on" was golden.

But I think that date is wrong. If it was 2 months after NHibernate v2.1 was released it certainly was not 20 nov 2007.

Ayende Rahien


No, that was not in 2007, it was in 2008.

I think they had the wrong template :-)


Good presentation, I enjoyed a few of the other ones I skimmed through as well.

As someone who has always worked for companies that are down right frightened of Open Source (especially for something as important as Data Access), I've only really played around with NHibernate and Active Record on my own.

So my question is, with Fluent NHibernate now on the scene, does the need for Active Record go away, or will the three of them play nicely together?

As a follow up, if I was going to start a medium sized project today (let's say something similar to the Hotel Reservation system from the presentation), would the ActiveRecord/NHibernate suffice, or would you (meaning anyone) suggest trying to integrate Fluent NHibernate into the project?

Thanks in advance.

Ayende Rahien



I would recommend going with Fluent NHibernate until your model has settled down, at which case I would move to HBM XML files, for custom configuration

Peter Morris

The slide in the video says November 2007, I presume that's wrong?

Do you only use AR for prototypes and very simple apps then? Do you ever just use NH and leave AR out of the picture?

Ayende Rahien


I now tend to more and more use NHibernate only.

I used to use AR for speccing and prototyping, I use Fluent NHibernate for the same purpose.

In both cases, there is some cut off point where I cut out the middle man and go to the XML.

Trying to setup complex stuff in either AR or FN is just ugly.

Peter Morris

How does Fluent NH cater for protected / private state?

Ayende Rahien


I have absolutely no idea :-)

Peter Morris

Nor do I, which is why I have stuck with XML in my experimentation :-D

Ayende Rahien


Try the FN mailing list

Frank Quednau

"I don't have to think, let's do UML" - Love that one!


Is this required specific NHibernate library? I try to create the example by using AR, it doesn't work


Great presentation. Something I learned when doing presentations: when someone asks a question, repeat it before answering so everyone can hear the question. None of the questions you answered were audible :-(

Comment preview

Comments have been closed on this topic.


  1. RavenDB Conference 2016–Slides - one day from now

There are posts all the way to Jun 01, 2016


  1. The design of RavenDB 4.0 (14):
    26 May 2016 - The client side
  2. RavenDB 3.5 whirl wind tour (14):
    25 May 2016 - Got anything to declare, ya smuggler?
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats