So I’ve Started the Journey…
A journey of a thousand miles begins with a single step.
Man, I can remember just a few months ago when NHibernate had almost no documentation (and what little it had was terrible).
Now it’s a 145-page beast. Okay, not quite as dramatic as 1000 miles, but still, damn thing took me like 15 minutes to print all of it. And no way in hell I’m getting a staple through all of the pages. I kinda liked reading the DLINQ documentation, so I figured it’s probably a good idea to reacquaint myself with NHibernate on a more intimate level.
I’m going to try and finish it on the plane trip in and out of Utah next week. Yah, I’m bringing my camera this time; missed some beautiful scenary last time :-S I think this week, it’ll really feel like I’m working at a new company. It’s been slow going as the company’s CEO has been working onsite with a client and the engagement is just ending now. This means that hopefully, the fun’s only starting to begin.
It’s 1:04 AM…what am I doing up reading about NHibernate?
Funny! I was doing the exact same thing at the same time. I was playing with the Nhibernate Query Analyzer. Here’s what I was looking at:
Thanks for the additional resources, Jon.
Definitely take a look once I finish up with the docs.
Interesting to see, if you read both DLINQ and NHibernate documents, back to back, how similar the two really are. Some of the feature sets that I thought were unique to DLINQ were actually implemented into NHibernate between the time that I was last working with it and now (or maybe I just never knew they were there?).
I think, at least in my view, the only thing that DLINQ adds (okay, aside from the neat-o language integration and a few features here and there) is legitimacy to the whole business of ORM in the .Net/MS space. Companies that wouldn’t touch NHibernate with a ten foot pole will readily jump on the DLINQ bandwagon once it’s released. I’m simply amazed at the stark differences at the level of technical managers/leaders and their approaches to development tools when comparing those with a Microsoft background and those with a Java background. Even in the small "start-up" company that I work for now…it’ll be a challenge to convince their existing developers and CTO that NHibernate can help increase productivity (after an admittedly high initial learning curve).
As a complete tanget, I found a stapler on sale that can staple through 25 pages (so the printed NH docs form three stapled packets using duplex printing). Almost went for the big kahuna 160-page stapler, but my more sensible half (read: wife) was on hand to keep me in check 😛
What general process or tools do you recommend for setting up a project based on NHibernate and Castle? I’d prefer not to write a bunch of NHibernate mappings by hand. The best I’ve come up with so far is to model a database and use MyGeneration to generate the NHibernate mappings – got a better plan?
Actually, I finished the documenation on the flight back from Utah last week.
In the past, I used a set of MyGeneration templates as you’ve been doing it seems. I dunno, I don’t mind DDL so much (I always hand write *all* of my DDL anyways because I’m nuts like that).
In general, it would seem to me that, as much as you would probably dislike it, the best place to start from would be the hbm.xml files 🙂 The NHibernate package, from the documentation, contains tools to generate both "DTO" style, lightweight classes and DDL via the CodeGenerator and SchemaExport utilities (updates of hbm2ddl and hbm2net??).
If you’re not into the whole mapping file business, perhaps you should look at the NHibernate.Mapping.Attributes package in NHibernateContrib package. The documentation says that hbm.xml files can then be generated from attribute marked up classes (versus standard manual generation).