introduction to orm patterns with code samples in nhibernate

15
Introduction to ORM Patterns with Code Samples in NHibernate Mohamed Meligy

Upload: mohamed-meligy

Post on 27-Jan-2015

115 views

Category:

Technology


3 download

DESCRIPTION

ORMs are not just certain products like LINQ To SQL, Entity Framework, NHibernate, LLBLGen. It’s a design pattern that each ORM vendor has his own understanding of it and way of implementing. In this session we go through the most common implementation patterns with code examples in NHibernate and remarks on how other ORMs implement the same functionality (or not). We are likely to talk about many language, framework features and tools like Expression Trees and Reflection and code generation.

TRANSCRIPT

Page 1: Introduction To ORM Patterns With Code Samples In NHibernate

Introduction to ORM Patterns with Code Samples in NHibernate

Mohamed Meligy

Page 2: Introduction To ORM Patterns With Code Samples In NHibernate

Who Am I ?

• 2005: Blogging, http://geekswithblogs.net/Mohamed, http://weblogs.asp.net/meligy, http://GuruStop.NET

• 2006: SilverKey Demo Day 1• 2007: SilverKey Demo Day 2• 2007: Several dotNETwork Gatherings• 2008: ITWorx Cutting Edge Club• 2008: Several dotNETwork Gatherings• 2009: doeNETwork Code Camp`09• Worked in SilverKey, Raya Experts Team• Currently Working in Abu Dhabi• 2010: doeNETwork Code Camp`10

Page 3: Introduction To ORM Patterns With Code Samples In NHibernate

THIS IS JUST OPEN TALK SESSION!

This is not to recommend Nhibernate or else…

Page 4: Introduction To ORM Patterns With Code Samples In NHibernate

Topics To Discuss

• ORMs!• Model First and Mapping Techniques• POCO and Active Record• Loading Techniques

Page 5: Introduction To ORM Patterns With Code Samples In NHibernate

Classic ApplicationsDatabase• Persistence (Tables,..)• Data Objects (SPROCs, etc…)

SQL Helper Classes

Create / Read / Update / delete

Business Logic (queries, conditions)

UI

Page 6: Introduction To ORM Patterns With Code Samples In NHibernate

http://tinyurl.com/meligy-orms

Database

ORM Layer

ORM Calling Code

Business Logic

UI

The Case With ORM

Page 7: Introduction To ORM Patterns With Code Samples In NHibernate

ORM

objects relational

Page 8: Introduction To ORM Patterns With Code Samples In NHibernate

http://www.kevinwilliampang.com/post/How-Fanboys-See-NET-ORMs.aspx

Page 9: Introduction To ORM Patterns With Code Samples In NHibernate
Page 10: Introduction To ORM Patterns With Code Samples In NHibernate
Page 11: Introduction To ORM Patterns With Code Samples In NHibernate
Page 12: Introduction To ORM Patterns With Code Samples In NHibernate

POCO

Page 13: Introduction To ORM Patterns With Code Samples In NHibernate

THE MAPPING

Page 14: Introduction To ORM Patterns With Code Samples In NHibernate

DEMO

Page 15: Introduction To ORM Patterns With Code Samples In NHibernate

Where to go…• ORM

– http://weblogs.asp.net/fbouma• http://llblgen.com

– http://en.wikipedia.org/wiki/Object-relational_mapping

• NHibernate– http://nhforge.org

• http://nhforge.org/blogs/nhibernate• http://nhforge.org/doc/nh/en/index.html

– http://blogs.hibernatingrhinos.com– http://sharparchitecture.net– http://groups.google.com/group/nhusers

• http://ayende.com• http://tekpub.com• http://dimecasts.net• http://www.slideshare.net/pagsousa/poeaa-by-example• http://GuruStop.NET

[email protected]