Using Active Record to write less code
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.
Comments
Are not available, or are now available?
I think instead of "not" you meant "now". :)
Yeah, probably one of my most common typos
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.
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
John,
I have never been able to measure the difference.
Eric,
Yes
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.
Krzysztof,
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.
Andrew,
Today?
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
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?
Peter,
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.
How does Fluent NH cater for protected / private state?
Peter,
I have absolutely no idea :-)
Nor do I, which is why I have stuck with XML in my experimentation :-D
Peter,
Try the FN mailing list
"I don't have to think, let's do UML" - Love that one!
@Ayende
Fluent NH mapping of private members.
wiki.fluentnhibernate.org/.../StandardMappingPr...
I think I like this one best
Reveal.Property("Id")
At least only as bad as XML :-)
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