introduction to nhibernate

15
Emad Alashi Technical Team Leader in eSense software http://eashi.wordpress.com emad.ashi@gmail.com

Upload: emad-alashi

Post on 16-Apr-2017

4.706 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Introduction To NHibernate

Emad AlashiTechnical Team Leader in eSense software

http://[email protected]

Page 2: Introduction To NHibernate
Page 3: Introduction To NHibernate

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

Page 4: Introduction To NHibernate

DB

Connections, Transactions,…

Insert Commands

Update Commands

Delete Commands

Retrieve Commands

Conv

ert

to B

O

Dom

ain

Obj

ects

Page 5: Introduction To NHibernate
Page 6: Introduction To NHibernate

• 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!

Page 7: Introduction To NHibernate

DB

Connections, Transactions,…

Insert Commands

Update Commands

Delete Commands

Retrieve Commands

Conv

ert

to B

O

Dom

ain

Obj

ects

Configuration

Page 8: Introduction To NHibernate

• 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

Page 9: Introduction To NHibernate

Database

XML mapping file

Domain Object

Page 10: Introduction To NHibernate
Page 11: Introduction To NHibernate

• 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

Page 12: Introduction To NHibernate

• Session and SessionFactory• Objects Identity• Collections (one-to-many, many-to-one, many-to-many)• <Union>• Inheritance• ICriteria• HQL• Caching• Interceptors• Performance Tuning• …

Page 13: Introduction To NHibernate

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

Page 14: Introduction To NHibernate

Thanks for attending

http://[email protected]

Page 15: Introduction To NHibernate