15.01.2013 Views

Foundations of Programming - Karl Seguin

Foundations of Programming - Karl Seguin

Foundations of Programming - Karl Seguin

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6 - Object Relational Mappers<br />

session.SaveOrUpdate(salesPerson);<br />

without ever having to actually hit the database to load the Model.<br />

Download<br />

You can download a sample project with more examples <strong>of</strong> NHibernate usage at:<br />

http://codebetter.com/files/folders/codebetter_downloads/entry172562.aspx. The code is heavily<br />

documented to explain various aspects <strong>of</strong> using NHibernate. (If the above link does not work for you,<br />

you can try this alternative download location: http://openmymind.net/CodeBetter.<strong>Foundations</strong>.zip).<br />

In This Chapter<br />

We’ve only touched the tip <strong>of</strong> what you can do with NHibernate. We haven’t looked at its Criteria<br />

Queries (which is a query API tied even closer to your domain), its caching capabilities, filtering <strong>of</strong><br />

collections, performance optimizations, logging, or native SQL abilities. Beyond NHibernate the tool,<br />

hopefully you’ve learnt more about object relational mapping, and alternative solutions to the limited<br />

toolset baked into .NET. It is hard to let go <strong>of</strong> hand written SQL but, stepping beyond what's<br />

comfortable, it's impossible to ignore the benefits <strong>of</strong> O/R mappers.<br />

You're more than half way through! I hope you're enjoying yourself and learning a lot. This<br />

might be a good time to take a break from reading and get a little more hands-on with the free<br />

Canvas Learning Application.<br />

<strong>Foundations</strong> <strong>of</strong> <strong>Programming</strong> Copyright © <strong>Karl</strong> <strong>Seguin</strong> www.codebetter.com<br />

52

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!