For those following along, I have just posted the 15th (yes, I know it says ‘Session 14’, there was a ‘2a’, remember? ) and final installment in the Summer of NHibernate screencast series for download.
As promised, in this installment we port our data-access-layer code and related unit tests to the recently-minted NHibernate 2.0 release (well, actually my code is using the build from the trunk for the upcoming 2.1 release, but there’s no difference as far as the code in the sample project should be concerned ). As part of this process, we take a look at some of the breaking changes between NHibernate 1.2 and 2.0 as well as discuss some of the new features that 2.0 offers to give viewers a good sense of where they will need to make changes in their existing projects to support an update from 1.2 to 2.0.
Since this is the last installment in a series whose focus was explicitly just on the basics needed to get started, we also take some time to discuss some on-line resources for learning more about NHibernate as well as list some other OSS frameworks and tools that can work with, depend on, and compliment NHIbernate in your development process.
Good luck on your continued journey!
If you are reading this post and have been watching this screencast series, the part of the NHibernate journey that you can take with me has reached its end, but recognize that you are just at the beginning of a much longer journey of learning that can take you into the much more advanced features of the NHibernate O/R Mapping framework. There is a tremendous lot more out there to learn than the (relatively) small parts of the system that I attempted to cover in these sessions.
A Note of Thanks to the Community
I want to take a brief moment at the end of this series to offer heartfelt thanks to those who contributed any amount of money at all to help defer my bandwidth/hosting costs, feedback and input as to the content, quality, and structure of the screencasts, suggestions for additional topics, encouragement, constructive criticism, or any combination of all of the above. And a special shout-out to Scott Hanselman who both helped publicize this effort on his blog (that gets A LOT more traffic than mine!) as well as talked some sense into me during a phone call that got me to create an easy-to-remember domain name for the content and host it somewhere legitimate even if it is costing me some money.
When I started this effort of releasing these to the community way back in late June, I really didn’t know what to expect. Would anyone find value in these? Would anyone follow along for 15 whole weeks (or even a bit more like 18-20 since I skipped about 2-3 weeks towards the end there when my other obligations got in the way) except our own employees who really sort of have to watch them ? Was it the right thing to expand from the original 5-6 installments to the eventual 15?
I have to say that the number of donations pleasantly surprised me (although sadly I still cannot quit my day job ) as did the level of positive feedback I received. But the numbers of viewers that are pointed to by my analysis of the bandwidth used on my hosting server is what really completely blew me away…
Several of you have asked questions about how many people have been downloading the screencasts and I just wanted to share with you some quick approximate stats to give you a sense of the volumes:
- average size of each of the 14 video files: 185MB
- total bandwidth for downloads to-date: approximately 2TB
If you divide 2TB by 185MB, you get an amazing number of about 10,700 total individual downloads. If you assume that every visitor has downloaded all 14 prior-posted installments exactly once, you get 10,700 downloads / 14 screencasts = about 760 individuals that would have downloaded the entire screencast series .
Personally, I find that to be an amazing number. When I started to release these, it never dawned on me that there would be anything even approaching that level of interest. Likely what’s going on here is that some will have downloaded just a few of the installments and still others may have downloaded a single installment more than once (to get it at home then also at work, for example), so these numbers really represent just a very crude approximation. And in this era of podcatcher software I’m sure plenty of people have subscribed to the RSS feed and auto-downloaded the content but never bothered to actually watch it.
But if anyone can find fault with the conclusions I’ve reached with this bandwidth analysis, please chime in as I’m interested to hear where my conclusions may be flawed. 750+ viewers seems an incredible conclusion to me, but I don’t see any other viable explanation for the bandwidth levels I’m seeing from my site hosting service. If my analysis is wrong and only 10 people are really watching these, that’s fine for my ego too but I’d like to understand where my bandwidth-analysis logic has gone astray.
As always in this and anything else I might post here, thoughts, comments, (constructive) criticism, and feedback are always appreciated~!
And I’ll hope to see you again during the hopefully soon-to-start Autumn of Agile series.
i just wanted to say thanks, your videos really helped me learning NHibernate… it was just amazing! You really did a very good job. I really love the way you presented the material. and the way you let errors be captured during the coding session… then fixing it and explaining why they happened…it really helps, in a way that can’t be done easily by just explaining or stating the concept.
can’t wait to watch your agile series!
Instead of re-stating what darnell said, I just vote-up his comment 😉
Great end to an excellent series !
Since I’ve been using NHibernate v2 from the beginning, I had to make the same modifications that you showed in this presentation. It took me a bit longer though 😉
Regarding bandwidth cost, you might consider creating torrents for your screencasts.
I also want to say thank you. You did an amazing job. I hope that as you use NHibernate 2.1 you still post some videos or blog entries on your thoughts and ideas on how you use this stuff. Looking forward to your agile series. Keep up the great work.
Thanks looking forward to the agile series. I downloaded all the series. i don’t think your calculation is wrong.
..except our own employees who really sort of have to watch them
Gettin’ payed to watch this ? Sounds like a hell of job to me !. Where do I apply ? (Do you hire Europeans ? 😉 )
The no. of downloads _might_ not be a good indication of the no. of people that actually watched it. I’ve shared my downloaded files with my co-workers.
Just image how much your bandwidth cost would have been if your name was Scott Hanselman 🙂
Maybe you could approach the ALT.Net/DotNetRocks/HanselMinutes/PolymorpicPodcast guys for an interview. That might attract some additional people.
I wanted to thank you for your excellent work. How cool would it be to have material like that for all the devs when a new project is about to start? 🙂
As “One” said I also shared my downloads so probably you reached more people than you think.
That’s an interesting point; I hadn’t considered that downloaders would in turn re-distribute the content to others, further extending its reach. I guess that makes my analysis of likely viewers a MINIMUM value rather than a maximum…which only serves to make it *more* amazing to me 🙂
I want to thank you for this excellent screencast series. There are many NHibernate tutorials/helpful resources out there, but in my experience a screencast always makes a huge difference. Your series has definitely helped me understand more of NHibernate.
I have shared your screencasts with co-workers and friends. They are glad they could learn a lot from your series. An interesting comment I got from one of them was “Why don’t we have such screencasts in the Java world”. I would leave this for debate.
Thanks again and looking forward to your agile series.
This was an excellent series on NHibernate.
Thank you very very much
I was one of the guys who asked for the download stats. Now that I know the answer, I don’t really know what to make of it. Let’s say 1K people watched the whole series. Is that a lot ? Well, I have no idea.
Maybe it’s just me, but I’d be very interested to know _why_ people invested 15+ hours watching this series. A good friend of mine told me: ‘The new Battlestar Galactica season won’t start until 2009, so I decided to watch this series instead’. I think it’s save to say that this might be an isolated case :-).
Another thing that I’m curious about, how did watching this series affect YOU ? No Steve, not you 😉
So here’s my story …..
I first heard about SoNH when Scott Hanselman posted about it. When it was mentioned again on a ALT.Net podcast I got curious and decided to download and view the 1st episode.
Somehow that episode just ‘clicked’ with me and led me to download and watch the next episodes.
I really like your style. To quote ‘darnell’: .. and the way you let errors be captured during the coding session… then fixing it and explaining why they happened…it really helps, in a way that can’t be done easily by just explaining or stating the concept.
I’ve posted some similar words, but he said it better 🙂
Net result ? We’ve started to use NHibernate in our current projects. I’ve been able to convince my co-workers of the benefits, after tying them to a chair and making them watch these series (A Clockwork Orange style 🙂 )
So I’m calling on the readers of this blog, please post your experiences/stories. I’d love to hear them !
@Steve: hope you don’t mind this.
I don’t mind in the least; I’d enjoy hearing from anyone who has a story to share about what they got out of this effort of mine.
And after the next season of Battlestar Galactica starts, I’ll have to rely on efforts like yours to *forcibly* enlarge the viewership of these screencasts using a combination of ropes and chairs. Nice 😀
I get the image of the HitchHiker’s Guide to the Galaxy’s Poetry Appreciation Chairs on the Vogon ship…but anyway…
I also want to thank you for this series. As someone who has been curious about nHibernate but didn’t know where to begin, this series pointed me in the right direction. I’m not done watching them all yet (on 6 or 7), as I keep going back to reinforce some piece of information, as I’m coding my new project using it.
For someone who learns best by ‘doing’ this series was perfect for me. You were always in step with my questions. Everytime I saw you do something and though ‘Now why would you do that…’, you’d say something like ‘Now I did that….’
Fantastic…can’t wait to see your next series. 🙂
I started out using NH a few months before this series came out, and really struggled to find any decent structured information. Mostly it was reading many blog posts and articles on how to this or that, or navigating the nh Help, to get the application to work but not having a full appreciation why I was doing the way I was.
Then I stumbled on your Summer on nHibernate series. I found that the presentations were very helpful in my understanding of NH. I still have a few to go, but find that your style of presentation easy to understand and follow.
And like other people that have stated already, having the demo’s throw various exceptions and then explaining why those exceptions happen has been very helpful as I have come up against many of them as well and trying to find an explanation as to why it happened has been difficult.
Again, Thank you for a great series and look forward to the next series :).
you did an an excellent series on NHibernate.
but one more thing i wanted to request that… would you planning a screen cast for Active record? since you have already used this and it should not take more than 30 minutes (i guess so)
would you please?
Thank you very very much
I have also shared these videos with others. I inherited a project where NH was used and finding any useful information on how it all works was very difficult.
This series was excellent as most of the information I could find already assumed you had a fairly good understanding of NH which I did not. After watching all of you videos I can safely say the people who wrote the application I inherited obviously did not have a great understanding of NH either. We were considering removing NH from our application as it was causing more troubles than it was solving but after watching your series we have changed our mind.
While researching NH I found a lot of comments about issues with NH including performance and I now wonder if a lot of this has to do with the misuse of NH. If there was more info like this out there perhaps there would be less of these stories.
To give you an idea of how useful I thought these were, I downloaded these at home, watched them in my own time and even donated (only a small amount sorry). That is the first time I have ever voluntarily paid anything for content like this over the web.
I eagerly await your Autumn of Agile series so I can get answers to all those questions you mentioned you have already been asked regarding more real world apps.
Thanks for your effort.
Thank you for posting an NHibernate tutorial for the “rest of us”, who – though we reviewed the docs, blog posts, books, and other information on NHibernate – were still wandering in the wilderness, unable to pull together a successful application using this wonderful tool.
The design of the topics and the content of these screencasts were right on target. Your presentation style was excellent!
I cannot express how grateful I am that you took the time, effort, and expense to produce and share your extensive knowledge of NHibernate and .Net with us. I’m looking forward to your future presentations!
Thanks for the feedback; its nice to see that you found value in the content. I’m also glad that you liked the ‘style’ of the presentations — when your audience is not in front of you in real-time, it makes it a bit hard to tweak your delivery by watching the faces of the audience either nod in understanding or swirl with incomprehension 🙂
That’s really great to hear — I’m happy that this content may have been able to assist you in making the choice to stick with NHibernate in the application you’re dealing with at work.
BTW, I appreciate your donation; every little bit, no matter how small, helps defer some of the cost of providing these and makes it easier for me to continue to produce more content.
Your sessions are really great! Thanks, you made an excellent job. I’ve seen in your last session that you use DevExpress Components and obviously also XAF (you were looking for references somewhere).
How does the ORM of DevExpress compare to the latest NHibenrate release?
Thanks in advance for your feedback
Thanks for the comments; I really appreciate the input and am glad to hear that you found the series content to be helpful to you.
Re: the DevExpress XPO )Express Persisten Objects) I have to admit that its been some time (at least 2-3 years) since I’ve looked at it and considered it as an ORM tool. Before I settled on NHibernate, the DevExpress XPO tool was one of many (about 8-10) ORM frameworks that I evaluated and considered for my company and our dev staff to commit to seriously learning/using for most of our non-trivial solutions.
I (obviously) eventually dismissed it as viable though I cannot entirely recall exactly why (this was a few years ago at least by now). My recollection was that it was limited to being tightly tied to the database schema and as such wouldn’t let my object model diverge from the DB schema in any significant manner, but frankly that may be entirely wrong (based on my recall only).
I think (in general) that when I discovered NHibernate and managed to become knowledgable enough with it to use it effectively (it took me three tries over about a year to manage even that) and it did what I needed and cost absolutely zero $$$, I just went with it rather than any of the commercial implementations of ORM toolsets. NHibernate also best fits my view of what I value in my codebase (loosely-coupled objects with well-defined extension points, etc.) and so felt like it was well-suited to my value system.
thanks for your feedback. I think I stick with NH. I cannot tell you often enough how much I appreciate that you have published the video sessions. I walked through most of the things myself and found it not very easy to understand fully all the concepts.
Two more questions I got, maybe you find time for a short comment:
1. Castle/Active Records:
I do not quite understand what it’s for. As far as I understood it is an addition abstraction of NH (true?) which could be used in rather simple scenarios, but when we need the full potential of NH we should stay with pure NH. (examples form project: lots of bags with FK-Relationships, different cascading scenarios, entity classes are supposed to be partial)
Is that true? I currently work with MyGeneration (OHM script) and an additional code modification script which goes over all generated files and makes individual customization – Would you recommend in my case Castle Active Records anyway? There is not much activity in this project (Version 1.0 CR3 for over one year)
2. Do you think additional sessions? E.g. I missed the event features of NH 2.0. These and some other NH 2.0 features could be very interesting. I mean you provided an excellent and solid base for working with NH. If you would go on with lets say two or three additional sessions (NH advanced) your page would be a real boost to the whole community (it is already – no doubt) and probably THE reference for starting to work with NH!
I mention that because I worked through the book NH in Action. It was published in the last month, but does not mention NH 2.0 and it would be sad if the huge steps forward of the version are reserved to small community.
Thanks already for your reply.
I wouldn’t be at all ‘fearful’ of the fact that the Castle Project appears mostly ‘inactive’. I (personally) use the project’s Windsor Container as my IoC tool of choice with great success. Up until just very recently NHibernate itself took a dependency on the Castle Dynamic Proxy library for its lazy-loading support(which is still its default though now you can replace that with your own proxying engine if you need to).
The stated reason that the Castle Project remains at 1.0 RCxxx rather than having reached a formal 1.0 RTM is philosophical: the project team’s vision for Castle is for it to be able to do several things that are not yet entirely possible in the .NET framework. Because they feel strongly that Castle 1.0 should have these features in order to be feature-complete, they have (wrongly in my view) decided to leave the thing at RC-status rather than just going to 1.0 RTM and saving the additional ‘wish-list’ feastures for Castle v 2.0 or something.
As a result of this choice, to anyone not familiar with this ‘backstory’ it looks like Castle has been ‘stuck’ at 1.0 RCxxx status and abandoned. This is most definitely NOT the case, but this is why I personally disagree with their decision not to RTM until they can somehow overcome some limitations of the framework (which of course won’t happen and they are stuck hoping that MS solves a few ugly architectural gotchas in some subsequent framework release). It sends absolutely the wrong message to anyone considering adopting anythign from the Castle Project.
That said, you are pretty much correct in your estimation of the role of Castle ActiveRecord being a simplification/abstraction atop NHibernate; like its name suggests, Castle ActiveRecord is an implementation of the more general Active Record data-access pattern (google it for more info) that basically says ‘for every table in my DB, I will have a class and for every field in my table I will have a property’. If this suits your project’s data-access needs then Castle ActiveRecord can be a great way to get your data-access accomplished without the complexity (or frankly the flexibility) of ‘full’ NHibernate. SubSonic (by Rob Conery) falls into this same category of being an implementation of the Active Record pattern, as do .NET datasets and a number of other technologies (that space is pretty well saturated with a variety of choices of tools).
Re: a follow-on screencast showing some of the more advanced NHibernate features (or more about 2.0 features), I might indeed spend some time doing this but my immediate feeling is that there are already great resources out there that can focus on just one more specific NHib feature (the eventing model you mentioned, for example). Once someone has learned the fundamentals (hopefully from my screencasts 🙂 ) then my thought is that its more reasonable for someone to read a blog post about some additional feature, etc. and be able to make sense of it having already grasped the fundamentals from something like my screencasts.
There are great posts from people like Gabriel Schenker, Davy Brion, Ayende Rahein (of course), and others that focus more deeply on edge cases, a single specific feature, or a more narrow how-to in just one area for people interested in diving into more of the specifics of any one feature. Your point about the screencasts being a great medium for delivering that same content is well-taken, but I really wanted to focus on delivering content in my screencasts that is NOT really available elsewhere (or at least not as coherently organized) rather than duplicating what’s already out there.
I hope that makes some sense and thanks again for the feedback.
Steve, you mentioned that with 2.0 it was a requirement that even reads be done in the context of a transaction yet methods in the series like CRIT_GetCustomersByFirstname are still just simple returns. Did I misunderstand something?
Sort of. Here is a link to a post that begins to describe this issue in a bit more detail…
See this thread also (from the NHUsers google group…
The series is fantastic – we are implementing NHibernate on some smaller projects now and if things go well then we will also use it for our bigger projects.
One thing I am stuck on in converting from MbUnit v2 to v3 is that Assert.Warning is no longer valid in v3. According to the only post I can find on the subject (http://blog.bits-in-motion.com/2008/10/announcing-gallio-and-mbunit-v304.html) I should now be using TestLog.Warning.WriteLine instead of Assert.Warning – but I have not been able to get this to work; intelisense does not recognise TestLog and it won’t compile. How did you overcome this issue? Is the syntax wrong or is there a better pattern for checking that there are results and warning if there are not?
I’ve got a question that probably falls under the category “Further Exploration”.
I have created a demo app to help me learn architecture with NHibernate. I am using a very basis architecture with two layers, each in a separate project:
— Core (domain model and mapping files); and
— DataAccess (data access code).
The DataAccess project has several repositories, which return objects or collections, and a DatabaseManager, which holds an NHibernate session factory. This project holds a reference to NHibernate, and ‘Copy Local’ is set to true. The Core project has no reference to
I am using a separate unit test project to drive the app It calls repository methods to get the populated objects it needs and to persist objects. The test project does not have a reference to NHibernate.
Obviously, I am trying to isolate knowledge of NHibernate to the DataAccess project. Here’s my question: Is this a viable architecture for working with NHibernate? Any suggestions on how to improve it?
Thanks for your help!
I found the answer to my question–Yes, you can encapsulate NHibernate in a DataAccess project and isolate it from the rest of the app. The architecture works fine.
I had a problem that actually related to the idiocyncracies of a SQL CE private installation. For anyone with a similar problem, I posted the same question, and it’s solution, on the NHibernate forum at Hibernate.org.
I tried to use the Microdesk.Utility.UnitTest against a SQL Server 2008 database using schemas and the SaveTestDatabase() method cannot find my tables like it did when I was using it against an identical SQL Server 2005 database without special schemas (technically dbo only).
Does your utility support schemas? Am I doing something wrong?
Any tutorail for NHibernate 2.0 for enterprise apllication?
I’ve just completed your screencast series and I just want to thank you so much for taking your time to do this. 4 years after you created them, and even though NH 3.3.1 is already out, these videos still serve as a great introduction to NHibernate which can be quite intimidating at first look.
Keep up the good work!
P.S.: You might want to add some CAPTCHA to your blog since it appears some bots are taking advantage of it.
This is WAY easier to use than NHibernate: