Download - Introduction To NHibernate
Emad AlashiTechnical Team Leader in eSense software
http://[email protected]
Most of the applications in the business world are data-centralized (yes…database!):
1- Retrieve data from DB2- Process data
3- Save data to DBDB
DB
Connections, Transactions,…
Insert Commands
Update Commands
Delete Commands
Retrieve Commands
Conv
ert
to B
O
Dom
ain
Obj
ects
• Code writing:• SQL queries and SP• DB connectivity objects (connections,
commands…etc)• CRUD Operations (Create, Read, Update, Delete)• Integrity (scalar to OO, object identity…etc)
• Code maintenance:• Look above!
DB
Connections, Transactions,…
Insert Commands
Update Commands
Delete Commands
Retrieve Commands
Conv
ert
to B
O
Dom
ain
Obj
ects
Configuration
• Programming technique for converting data types between relational databases andobject-oriented programming languages(Wikipedia)
• OOP vs. Relational• Examples:
• Hibernate• ORM.net• ObjectMapper• Genome• NPersist…etc
Database
XML mapping file
Domain Object
• O/R mappers benefits:• Productivity: less code to write/maintain• Abstraction: transient to different DB
technologies• Consistency• Quality: depending on the product
• Challenges:• Learning curve
• Session and SessionFactory• Objects Identity• Collections (one-to-many, many-to-one, many-to-many)• <Union>• Inheritance• ICriteria• HQL• Caching• Interceptors• Performance Tuning• …
http://en.wikipedia.org/wiki/Object-relational_mapping
http://davidhayden.com/blog/dave/archive/2005/03/19/876.aspx
www.hibernate.org http://forum.hibernate.org/viewtopic.php?t=952439 http://www.theserverside.net/tt/articles/
showarticle.tss?id=NHibernate http://www.codeproject.com/KB/database/
Nhibernate_Made_Simple.aspx http://groups.google.com/group/nhusers
Thanks for attending
http://[email protected]