NHibernate Object/Relational Persistence for.NET.

Slides:



Advertisements
Similar presentations
Introduction to ECO Malcolm Groves
Advertisements

V 6, Mats Strandberg ORM With Hibernate.
Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
A Ridiculously Easy & Seriously Powerful SQL Cloud Database Itamar Haber AVP Ops & Solutions.
An Object/Relational Mapping tool Free and open source Simplifies storage of object data in a relational database Removes the need to write and maintain.
A Workflow Engine with Multi-Level Parallelism Supports Qifeng Huang and Yan Huang School of Computer Science Cardiff University
XStudio Quick Overview Eric Gavaldo
2 A bank application needs to access information from the customer database and integrate it with loan credit history information stored in a legacy database.
Rock Solid Data Access Kevin McKelvin
J-Interop Open Source Java COM Bridge. Contents What is it ? Comparison with Java Native interface Comparison with J-Integra® for COM Benefits of using.
CF and JSP/Servlets Developed originally by Robi Sen For the CF UnderGround II Seminar, Apr 2001 Edited and enhanced by Charlie Arehart (Robi had an emergency.
COM vs. CORBA.
The Top 10 Reasons Why Federated Can’t Succeed And Why it Will Anyway.
.NET Database Technologies: Open-Source Frameworks.
Hibernate 1. Introduction ORM goal: Take advantage of the things SQL databases do well, without leaving the Java language of objects and classes. ORM.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
Object Relational Mapping. What does ORM do? Maps Object Model to Relational Model. Resolve impedance mismatch. Resolve mapping of scalar and non-scalar.
Session-01. Hibernate Framework ? Why we use Hibernate ?
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
The POSTGRES Next - Generation Database Management System Michael Stonebraker Greg Kemnitz Presented by: Nirav S. Sheth.
Rice KRAD Data Layer JPA Design Eric Westfall July 2013.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Architecture of Enterprise Systems: Domain Model and Database layer
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Object persistence with Hibernate in Decision Deck 1.1 Gilles Dodinet 2 nd Decision Deck Workshop 2008, February.
JBoss Cache. Cache A place to temporarily store data that is expensive or difficult to compute or retrieve. Caches should be fast to access. May or may.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 10: Service Component Architecture.
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Object/Relational Mapping with Hibernate Practical ORM.
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
Effective Test Driven Database Development Gojko Adzic
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006.
Hibernate 3.0. What is Hibernate Hibernate is a free, open source Java package that makes it easy to work with relational databases. Hibernate makes it.
1 Mapping to Relational Databases Presented by Ramona Su.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
Ganymede Simultaneous Release | © 2008 by Springsite B.V., The Netherlands made available under the EPL v1.0 Teneo Ganymede Simultaneous Release.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Rainbow: XML and Relational Database Design, Implementation, Test, and Evaluation Project Members: Tien Vu, Mirek Cymer, John Lee Advisor:
Fall CIS 764 Database Systems Engineering L18.2 : Object Relational Mapping … ….Object persistence.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
Portals: Architecture & Best Practices Greg Hinkle February 2005.
Hibernate Basics. Basics What is persistence? Persistence in Object Oriented Applications? Paradigm Mismatch.  The Problem of Granularity.  The Problem.
Persistence – Iteration 4 Vancouver Bootcamp Aaron Zeckoski
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
Module Road Map The Scope of the Problem A range of potential problems Lost Updates User A reads a record User B reads the same record User A makes changes.
Stuart Leitch “Code First” & DbContext.
Sean Chambers.  ORM stands for Object Relational Mapper  Maps your POCO (plain old clr objects) to your relational model using XML config  Relieves.
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
 Who I am  What is NHibernate? ◦ Object Relational Mapper ◦ A framework for building advanced frameworks ◦ Ported from Java ◦ A wide NHibernate ecosystem.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA (I) Chengyu Sun California State University, Los Angeles.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
Best 3 Software Development Languages. Hibernate Training Hibernate is a high-performance object-relational mapping tool and query service. Hibernate.
October 2014 HYBRIS ARCHITECTURE & TECHNOLOGY 01 OVERVIEW.
Best Institutes offering Software Development courses.
The Holmes Platform and Applications
New Technology: Why, What ,How
Introduction to Entity framework
Chengyu Sun California State University, Los Angeles
Introduction to Entity Framework
LOCO Extract – Transform - Load
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Entity Framework By: Casey Griffin.
ADO.NET Entity Framework
Transaction & Record Scoping
Teneo Ganymede Simultaneous Release Graduation Review
Developing and testing enterprise Java applications
Why should I care about SQL, if I have ORM?
Presentation transcript:

NHibernate Object/Relational Persistence for.NET

A little bit of background information…

.NET port of the Hibernate project (Java)

Mature architecture and proven concepts, already in use in many enterprise Java applications

Already quite popular in the.NET world as well

Popularity seems to be increasing :)

General Philosophy Of NHibernate

It’s all about POCO

Should work on most databases

As few constraints on your code as possible

Full OO support: inheritance, polymorphism, composition, single-valued and many-valued associations

Maximize performance and flexibility

Keep your code clean

Strong Points

Ideally suited for OLTP scenarios (web applications, service layers, …)

Database independence

Rich feature set

Mature

Extensible architecture

Large, active, helpful and growing user base

Plenty of articles, blog posts and documentation available

It’s Open Source (LGPL)!

Weak Points

Not suited (at all) for bulk data processing

No code generation, and no designer support either

Bad reputation in some companies due to lazy coding ( = abuse of lazy loading )

Plenty of outdated articles, blog posts and documentation available

It’s Open Source! (some companies just don’t like that)

Let’s look at some of the things we can do with NHibernate…

Transitive Persistence

Managing associations between classes in a transparent manner

Allows you to persist object graphs with one instruction

Needs to be configured for each association => fine-grained control over cascade settings

Hold on… why was every member in the Order class virtual?

I wouldn’t want to debug that either :)

Storing data in the database in an easy manner is great and all, but what about getting it out again?

Querying with NHibernate

Hibernate Query Language

It’s an Object Oriented query language

Criteria API

Makes it easier to compose queries dynamically from code.

LINQ… still not fully supported

Wouldn’t it be great if we could execute multiple queries in only one database roundtrip?

Future Queries

Can we efficiently update multiple records in one roundtrip as well?

As of NHibernate 2.1, we can do this with some new HQL statements

Data Modification With HQL

What about caching? Do we need to do that manually?

Of course not :)

Second Level Cache

Second Level Cache data is available to all sessions

We can cache entity instances…

But we can also cache the results of queries…

This is ideal for static (reference) data or even data that doesn’t change frequently

How does the cache deal with modified data, though?

We’ll update the database and the cache

NHibernate will never cache anything in the Second Level Cache automatically

It needs to be configured on a per-entity and per-query basis

All the caching power you want, without having to pollute your code

Only use this for data that doesn’t change frequently though

But where is the cache’s data stored?

That’s up to you… multiple providers are available: ASP.NET cache, MemCached, Velocity, Prevalence, …

At this point, I’m almost running out of time and there is a lot more interesting stuff that we won’t get to cover.

Like optimistic concurrency strategies…

Or pessimistic locking strategies…

Or the various identifier strategies…

Or the various inheritance strategies…

Or how automatic dirty tracking works…

Or how you can implement your own dirty tracking…

Or custom user types…

Or how to deal with entities that were detached from the session…

Or the generation of DDL scripts, for your specific database…

Or the various mapping strategies for complex domain models…

We didn’t cover any of the many extensibility points either…

Maybe some other time :)

If you want to learn more, be sure to visit

Oh, and check out my blog if you liked this presentation:

Questions?