460 likes | 610 Views
Persisting Rich Domain Models Using NHibernate. IStarShip. Agenda. Intro Unit Of Work Identity Map Demos Basics cascade & inverse querying Many-to-many Legacy databases Performance. NHibernate. Origins in Java (Hiberante 2001) First release 2004 Last release 2.1.2 (Nov 2009)
E N D
Agenda • Intro • Unit Of Work • Identity Map • Demos • Basics • cascade & inverse • querying • Many-to-many • Legacy databases • Performance
NHibernate • Origins in Java (Hiberante 2001) • First release 2004 • Last release 2.1.2 (Nov 2009) • Upcoming 3.0 release (Summer 2010) • http://nhforge.org/
Identity Map/L1 Cache ISession Unit of Work
maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
idgenerators sequence increment native assigned seqhilo hilo identity foreign guid uuid.string guid.comb uuid.hex
Cascade • none • save-update • delete • delete-orphan • all • all-delete-orphan
inheritance • table per class hierarchy • table per subclass • table per concrete class
legacy • Composite primary keys • Relations on non-primary keys • Join • SQL Queries • DB Generated fields
performance • Batching • Eager loading (eliminate N+1) • Query Cache • L2 Cache
i could go on an on... • NHibernate = endless number of features
resources • http://nhforge.org/ • http://ayende.com/blog • http://www.codinginstinct.com • http://sharparchitecture.net/ Torkel.odegaard@gmail.com http://tlo.googlecode.com/svn/trunk/presentations/nhibernate_elevate