What is the difference between nhibernate and entity framework




















This attribute-based approach will usually have higher and longer term value: a single artifact to maintain, and the opportunity to keep mappings in sync with the code in one place. Mind you, I didn't say I disliked it - I actually do, and use it all the time in Entity Framework - , but in the NHibernate community, its use is discouraged.

You seem to conclude that more features are better than less features. That may be the case, but sometimes I prefer an opinionated system with less complexity. Mike: I'm not a fundamentalist, and I use both. I'm not saying one is better than the other. What you say is true for me also, however, it is nice to have some of NHibernate standard functionality. Mike: Do you know that the next version of EF will spawn timer threads?

Hmm myself being a poor developer who needs everything to be simplified Its amazing how much easier NHibernate is over Entity Framework.. And yet seems to offer every which option I found it difficult to integrate it with my Web Site, and have to use NHibernator framework for managing session.

And regarding LINQ.. I wish i wish i wish Thanks for pointing out the differences. It would be cool, if someone cold give an opinion on the performance details between these two?

I think that Entity framwork is going very fast with his versions and it is growing very fast Hello sir, how to connectivity between entity framework and NHibernate is it possible to connect those framework. Home About Books Sign In. History First, a bit of history.

Architecture In NHibernate, there is a separation between the Unit of Work and the configuration and model instances.

Entity Framework can use: Attribute-based although attributes cannot express all of the available possibilities — for example, cascading ; Strongly-typed code mappings. Associations Regarding associations, both support one to one, one to many and many to many.

However, NHibernate offers far more collection types: Bags of entities or values: unordered, possibly with duplicates; Lists of entities or values: ordered, indexed by a number column; Maps of entities or values: indexed by either an entity or any value; Sets of entities or values: unordered, no duplicates; Arrays of entities or values: indexed, immutable. NET indexer is available. Properties NHibernate supports properties of entity types one to one or many to one , collections one to many or many to many as well as scalars and enumerations.

I've heard using an ORM can slow the system down. Does anyone know which ORM is better on speed and performance using Queries created in the C code and mapping to stored procedures? The project will use existing tables that are large and contain a lot of data, it will also use existing stored procedures that carry out complex tasks in a SQL Server DB. The ORM must be able to carry out transactions and have high performance when running the existing stored procedures and querying the current tables.

I can see that EF is a lot easier to use and has greater support but if NH the most suitable option? The Entity Framework is constantly implementing new features and everything is automated in your project. It is very easy to use Entity Framework, extend and refactor your code.

Windows Azure makes easy to deploy and change it. I would suggest you use EF but it depends of your project. Can you give us more details about it? You can find lots of comparison charts on Google, for example this one explains performance and this one differences. When you use Database-First in EntityFramework it is very easy to import and use stored procedures , for NHibernate it quite simple as well. Note that if you use a lot of stored procedures and not a lot of simultaneous users the choice of a ORM between those two may not be so crucial.

Also don't forget the performance of a tool is often based on the way to use it. If you misuse the ORM e. Perhaps you can instal both of them, look at how they work and check at their roadmap e. Entity framework to check at the evolution and interest. Both are great solutions, although I personally think NHibernate is better for an inherited database.

There are some things that are clearly better in NHibernate, such as second-level caching support. Documentation is probably a bit sparser than EF, but if you're willing to go through the learning curve, NHibernate gives you a lot more power. FluentNHibernate is great for typed mapping of classes to underlying tables but there are some places you will just have to revert to XML mappings. There is a new competing API from NHibernate itself however, and I have not checked it out yet the above blog post mentions it.

If you want to rely on VS tooling support, EF is better. However there will be some magic sometimes for e. EF can use reflection to even populate private properties of an object, NHibernate does not do that; this is a strength or a weakness depending on how you see it.

EF also works well with other Microsoft supplied-frameworks for e. Entity framework are not POCO classes, they also contains some lower level functionality along with business properties to work with database but nHibernate works with pure POCO classes.

Support for Extended cascading deletion of rows. More events included like preload, postload, updation, deletion. We would like to know your valuable feedback. Please update if you like to share anything more on this topic nHibernate vs Entity Framework. Your email address will not be published. Save my name, email, and website in this browser for the next time I comment.



0コメント

  • 1000 / 1000