Software Alternatives, Accelerators & Startups

NHibernate VS Dapper

Compare NHibernate VS Dapper and see what are their differences

NHibernate logo NHibernate

The official NHibernate community site. Download NHibernate. Read blogs. Contribute to the NHibernate Wiki. Find reference documentation.

Dapper logo Dapper

Dapper is a user-friendly object mapper for the .NET framework.
  • NHibernate Landing page
    Landing page //
    2020-02-21
  • Dapper Landing page
    Landing page //
    2024-09-11

NHibernate features and specs

  • Rich ORM Features
    NHibernate provides comprehensive Object-Relational Mapping (ORM) capabilities, allowing developers to easily map .NET objects to database tables, manage relationships, and perform complex queries.
  • Database Independence
    NHibernate abstracts database interactions, enabling support for multiple databases with minimal changes to the data access layer. This is beneficial for applications that need to support different database platforms.
  • Advanced Querying
    Supports both criteria queries and HQL (Hibernate Query Language), which allow for complex and dynamic query capabilities, providing more flexibility in how data is retrieved.
  • Lazy Loading
    Offers lazy loading of data, improving application performance by only loading objects when they are specifically requested by the application logic.
  • Active Community and Extensions
    Having a strong community and many extensions, NHibernate provides a wealth of resources, plugins, and extensions to enhance its functionality and ease of use.

Possible disadvantages of NHibernate

  • Steep Learning Curve
    Due to its comprehensive features and capabilities, NHibernate can be complex and may have a steep learning curve for new developers, requiring significant time to master.
  • Performance Overhead
    The abstraction layer introduced by NHibernate, while beneficial for flexibility and ease of development, can add performance overhead compared to direct database access.
  • Complexity in Mapping Configuration
    Configuring mappings of complex object models to database schemas can be challenging, and errors in configuration can lead to runtime issues.
  • Less Support for Modern .NET Features
    Compared to newer ORM tools like Entity Framework Core, NHibernate may lag in supporting some of the latest .NET features and syntactic sugar, affecting developer efficiency.
  • Documentation Quality
    While NHibernate has extensive functionality, the documentation can sometimes be lacking in clarity and completeness, posing difficulties for developers when troubleshooting issues.

Dapper features and specs

  • Performance
    Dapper is known for its high performance as it uses raw SQL queries and maps results directly to objects, which reduces the overhead of ORM frameworks.
  • Lightweight
    It is a micro ORM and thus does not add significant weight to the application. It only requires a single DLL, which is simple to integrate.
  • Flexibility
    Dapper provides the flexibility to write complex queries and take full advantage of SQL features, performing tasks that are cumbersome with full ORMs.
  • Easy Mapping
    Allows easy mapping of data from the database to C# objects, helping developers handle the conversion between the two seamlessly.
  • Open Source and Support
    Dapper is open-source and has a strong community support with regular updates and a wealth of resources available for learning and troubleshooting.

Possible disadvantages of Dapper

  • Lack of Built-in Features
    As a micro ORM, Dapper lacks some of the advanced features present in full-featured ORMs like Entity Framework, such as change tracking and full LINQ support.
  • Manual SQL Queries
    Developers need to write SQL queries manually, which can increase the risk of SQL injection and bugs if not handled carefully.
  • No Automatic Migration
    Unlike some ORMs, Dapper does not offer automatic database migration capabilities, requiring developers to handle schema changes separately.
  • Limited Database Support
    While Dapper supports many popular databases, it may not support niche databases or specific features that are easily managed by other ORMs.

NHibernate videos

Introduction to NHibernate: Setting up your Mappings

More videos:

  • Review - Fluent NHibernate: Getting started w/ your first mappings
  • Review - ActiveCommerce + NHibernate + SPEAK Part 1

Dapper videos

DAPPER FRAGRANCES REVIEW... NOT SPONSORED!

More videos:

  • Review - Dapper Cigar Co Cubo Sumatra Robusto Cigar Review
  • Review - BladeHQ / Vox Dapper - Quick Review
  • Review - Dapper Cigar Co. Desavlido Cigar Review
  • Review - Sharp and Dapper most comprehensive Review Ever. Sharp and Dapper Shirt Stays.
  • Review - VIRAL Fragrance DUPES Bianco Latte and Escapade Gourmande | Dapper Fragrances

Category Popularity

0-100% (relative to NHibernate and Dapper)
Web Frameworks
38 38%
62% 62
Development
39 39%
61% 61
Application And Data
44 44%
56% 56
Tool
46 46%
54% 54

User comments

Share your experience with using NHibernate and Dapper. For example, how are they different and which one is better?
Log in or Post with

Reviews

These are some of the external sources and on-site user reviews we've used to compare NHibernate and Dapper

NHibernate Reviews

We have no reviews of NHibernate yet.
Be the first one to post

Dapper Reviews

Essential .NET Core Libraries that Every Programmer should know
Dapper is another .NET Core mapping library focusing on the mapping between the programming language and database.
Source: positiwise.com

Social recommendations and mentions

Based on our record, Dapper should be more popular than NHibernate. It has been mentiond 8 times since March 2021. We are tracking product recommendations and mentions on various public social media platforms and blogs. They can help you identify which product is more popular and what people think of it.

NHibernate mentions (2)

Dapper mentions (8)

  • Guys, where do you shop for reasonably priced everyday office shoes?
    I've also heard good things about Thursday but never pulled the trigger. I tend to like Timberland boots, and while they aren't the most long-lasting, they are comfortable and can be had for very cheap if you wait for sales. I also have a pair of Banana Republic boots that I bought in a pinch a few years ago that have held up remarkably well and are super comfy. But Banana has gone through several revamps since... Source: almost 2 years ago
  • Fashion advice for men
    Dappered.com They focus on budget friendly mens fashion beginner stuff. The most helpful is that they'll point out sales, but then give you direct recommendations on what to buy so you're not overwhelmed with choices. Source: almost 2 years ago
  • Help with wardrobe to look older and clothing that is more durable?
    The only general advice I would give is to start on dappered.com. They target clothes beginners with quality affordable brands and will tell you exactly what to buy when there's a sale. You can also go to styleforum.net. Browse through their daily fit pics threads and just kind of take a note when someone looks good and what you like about it. Source: about 2 years ago
  • affordable men's fashion recommendations??
    Dappered.com if you're in the US. Their whole thing is affordable fashion for beginners. Source: about 2 years ago
  • Trying to dress like an adult. Help?
    Dappered.com They cover low cost mens fashion. Often when they post about a sale, they'll give you specific suggestions on what to buy. Source: about 2 years ago
View more

What are some alternatives?

When comparing NHibernate and Dapper, you can also consider the following products

Beego - Beego Web is official blog and documentation website for beego app web framework

Mikro orm - TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns.

Hibernate - Hibernate an open source Java persistence framework project.

Propel ORM - Application and Data, Languages & Frameworks, and Microframeworks (Backend)

Entity Framework - See Comparison of Entity Framework vs NHibernate.

Doctrine - An object-relational mapper for PHP that provides transparent persistence for PHP objects.