460 likes | 561 Views
Persisting Rich Domain Models Using NHibernate. IStarShip. Agenda. Intro Basics (Mapping / Session) More mapping and querying options Detached objects (update / merge) Componet & Value types Inheritance Concurrency Legacy databases Performance Common Errors / Problems. NHibernate.
E N D
Agenda • Intro • Basics (Mapping / Session) • More mapping and querying options • Detached objects (update / merge) • Componet & Value types • Inheritance • Concurrency • Legacy databases • Performance • Common Errors / Problems
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.
id generators 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