Unhandled Exceptions

18 Jun

Summer of NHibernate Session 01: Setup and Basic Usage Pattern Screencast is Available

I am pleased to announce that the first installment of the Summer NHibernate screencast series is finally available for download!

This first session covers the basic setup and usage patterns of the NHibernate object relational mapping technology and starts with the basics assuming no familiarity on the part of the user with NHibernate at all.  For background on the reasoning behind this video series refer to this previous post.

Screencast Session Outline

Session 1 (6/13): SETUP AND BASIC USAGE PATTERN

  • Get the NHibernate dlls and .xsd files
  • Demonstrate how to add the xsd files to VS XML intellisense capabilities to get syntax support in the XML files
  • Use a simple Customer — Orders — OrderItems style database
  • Hand-code DTO class for the ‘Customer’ table
    • Introduce the concepts of 1:1 relation between table and class
    • (the dumb-DTO pattern; start here since it’s by far the simplest way to work)
  • Hand-code the Customer.hbm.xml mapping file to expose people to this syntax
  • Hand-code the hibernate.cfg.xml file to expose people to this syntax
  • Setup the project in VS (data access class lib)
  • Setup a corresponding test class to go along with it (to be used to exercise the data access class lib)
    • Further demonstrates the value of unit tests as a ‘harness’ for exercising concepts in a safe vacuum
  • Code a simple method that demonstrates the basic mechanics of interacting with NHibernate to retrieve all Customers from the database
    • ISessionFactory, ISession, reading configuration(s)
    • Leveraging the using ( ) {…} block to ensure session is properly closes/disposed of when done

Screencast format and Download Server

So that a high visual quality for sessions can be maintained, these Screencasts are being recorded at a relatively high resolution of 1280×1024 and are projected to run for between an hour and an hour and a half in length.  As such the total download is easily a couple hundred megabytes in size and since I’m too frugal to spring for a for-fee download site for the content I have instead chosen to post the sessions at the www.4Shared.com web site. I have isntead chosen to post the content on the www.drop.io web site. 

4shared.com drop.io is a free content hosting site offering unlimited bandwidth and 5 GB of unlimited concurrent storage but there is a limitation that no single file can exceed 100 MB in individual size.  To circumvent this limitation I will be breaking the Screencast into two or more multipart ZIP files, each one just slightly under 100 MB of capacity.  In order to unzip the AVI file you will need to download all three parts of the multipart ZIP file listed below.  An additional download has also been provided containing the source code for the session used in the video for those interested in exploring the code.

While this approach results in a larger number of individual files to download, it allows me to post the content and make it available at a location with no bandwidth limitations associated with it.

As usual, comments and suggestions are welcome!

Download links for Session 01

Note that as with all of these screencasts, to successfully view them on your computer you will need to download and install the TechSmith Camtasia Codec.

  • Summer of NHibernate Session 01 Screencast Part 1 of 3
  • Summer of NHibernate Session 01 Screencast Part 2 of 3
  • Summer of NHibernate Session 01 Screencast Part 3 of 3
  • Summer of NHibernate Session 01 Code Sample

 Update: As mentioned here, all content has been moved to the Summer of NHibernate Web Site.

17 Responses to “Summer of NHibernate Session 01: Setup and Basic Usage Pattern Screencast is Available”

  1. 1
    daav817 Says:

    When I try to extract the zip…”Summer of NHibernate Session 01 Screencast Part 1 of 3″…I get an error. The error states that the file is corrupted. Can you help me?

  2. 2
    Aiden Montgomery Says:

    I am 22 minutes into the screencast, which is great so far, and you mention some “class cleaner code” that seems to format your class nicely. Is this something that you have done using CodeRush? I waste a lot of time manually cleaning up my classes after using CR to create the properties etc.

    Thanks for creating these screencasts.

  3. 3
    steve b. Says:

    Indeed it is via CodeRush though actually its via an OSS plugin that runs atop the DXCore libraries and doesn’t actually require CodeRush.

    For more detail (including links and a watch-out-for note about it), I just posted about some of the tools in the screencasts here: http://unhandled-exceptions.com/blog/index.php/2008/07/16/confessions-of-a-developer-tool-hound/

  4. 4
    steve b. Says:

    @daav817

    Instead of the multi-part ZIP files, just instead go directly to the http://www.summerofnhibernate.com site and download the single complete AVI directly from the link there.

    Reliability of the links on drop.io is just one of the reasons I switched from that distribution method to the more sane approach of placing links to each complete file on a site unto themselves.

    Let me know if this solves the problem for you or not.

  5. 5
    Marc Scheuner Says:

    Hey Mr. Tool Hound!:-)
    What tool do you use to generate those .hbm.xml files? I bet you don’t write all of those manually from scratch, right?
    Cheers, Marc

  6. 6
    sbohlen Says:

    @marc:

    Sure enough, no I usually don’t. An upcoming session will cover tools that we use to slave the DTOs and hbm files to the database schema (as well as tools we use to slave the DB schema to the DTOs and hbm files when that’s more appropriate too.

    We use a custom MyGeneration template (http://www.mygenerationsoftware.com) set to generate them as part of the build process.

  7. 7
    Dan Crowell Says:

    I love MyGeneration! Can I get a copy of the MyGeneration templates you use?

  8. 8
    sbohlen Says:

    @Dan:

    These (the templates) will be available as part of the code-download that accompanies the session where I talk about how to use them to have the DB drive the generation of the DTO classes and the .hbm.xml mapping files. Patience — this session is but a few installments away :)

  9. 9
    Nisar Khan Says:

    Hi Steve,

    videos are great i mean superb and you did a excellent job and if i haven’t get hold of your web site then i might have lost or never use nhibernate, thanks again.

    question for you :)

    in your class library project in class you right click you get the options of Test, Test with Debugger….etc.. how did you got that? is that VS2008 or do i have to download any addons (mbUnit) ?

    i installed MbUnit but I don’t see the options you have.

    any help?

    thanks

  10. 10
    sbohlen Says:

    @Nisar:

    Thanks for the feedback; I’m glad you’re finding the content to be helpful — I hope its gelping you to beecome a more effective adopeter of NHibernate.

    It may not surprise you to discover that I have a blog post about your specific question:

    http://unhandled-exceptions.com/blog/index.php/2008/07/16/confessions-of-a-developer-tool-hound/

    The tool that provides those ‘Test with…’ options is called TestDriven.NET and its listed there in that post about tooling. Hope this helps~!

    -Steve B.

  11. 11
    Suhair Hassan E Says:

    Thanks for these great NHibernate videos. I have never learn so much in such a short time. You are amazing. XML configuration and mapping topics are the ones that scared me on all these days from NHibernate. You really made those topics enjoyable and i never thought Visual Studio can help me that much in XML side!. Will you make screen casts on spring framework for .net?. Hearty thanks for upgrading me to the next level.

  12. 12
    sbohlen Says:

    @Suhair:

    Thanks for the feedback; I’m glad you’re finding value in the content and I hope this helps to make NHibernate a little more approachable for you — its really not that bad once you get your head into it but the dearth of resources that are scattered all over the internet makes it pretty unfriendly to the newbie (which tends to reduce its adoptability by all but the most persistent developers).

    Re: spring.net, I’m not really a Spring.NET guy so its unlikely that i will produce content on that framework although I am an avid CASTLE PROJECT adopter and so will likely be offering content on at least some of the larger components in the Castle framework (http://www.castleproject.org) later in the year or early next year depending on my schedule.

  13. 13
    rong Says:

    very good

  14. 14
    Kris-I Says:

    I rerun the video and I have a trouble, when I execute (compilation ok) a test:
    (…)failed: could not load an entity(…)

    I use NH 2.0.1, VS2008SP1 on Vista x64SP1, SQLServer 2008 Std

    Customer.hbm.xml

    hibernate.cfg.xml

    NHibernate.Connection.DriverConnectionProvider
    NHibernate.Driver.SqlClientDriver
    Data Source=ZEUS;Initial Catalog=AdventureWorksLT2008;Integrated Security=True
    true
    NHibernate.Dialect.MsSql2000Dialect

    Do you have an idea ?

  15. 15
    steve b. Says:

    @Kris-I:

    From this line, you are using the MSSQL2000 dialect on a SQLServer2008 platform…

    NHibernate.Dialect.MsSql2000Dialect

    THere is not yet a dialect avaialable to support MSSQL2008 and I have no practical experience using NHibernate with SQLServer2008, but I can recommend that you try the NHibernate.Dialect.MsSql2005Dialect instead as its much closer in surface area to the 2008 t-SQL syntax.

    There are (as far as I know) several new datatypes introduced in MSSQL2008 for which there is no support in NHibernate (the new lightweight date-time constructs, the spatial types, etc.) but I believe that if you stay away from those data types that didn’t exist in SQLServer 2005 the Nhib 2005 sql server dialect should work.

    Also, please ensure that you have watched ALL of the videos as its not until the last installment that I go through the steps needed to make the persitent classes work under NHib 2.x so make sure that you have followed those specific steps rather that attempting to apply what’s shown in earlier screencasts directly to Nhib 2.x-based code of your own.

    Hope this helps~!

  16. 16
    Abid Says:

    i’m a developer trying to get a job.I’m from India.
    It was great help for me but i’m very sorry i couldn’t donate.
    I assure you i’ll do so if i get a job.
    Great stuff guys.

    Thanks

    Abid

  17. 17
    sbohlen Says:

    @Abid:

    Glad to hear you’re enjoying the content and don’t worry about not being able to donate — that VAST majority of viewers didn’t so it places you in good company (or at least LARGE company!).

    Feel free to give what you can when you can — any help would be appreiated.

    Best of luck in your job search~!

Leave a Reply

© 2009 Unhandled Exceptions | Entries (RSS) and Comments (RSS)

GPS Reviews and news from GPS Gazettewordpress logo