Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Which ORM is better for my application NHibernate ,EntityFramework or LinqToSql? and why?

Which ORM is better for my application NHibernate ,EntityFramework or LinqToSql? and why?

Scheduled Pinned Locked Moved The Lounge
question
32 Posts 21 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AbdelrhmanRaafat
    wrote on last edited by
    #1

    I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

    P L P K D 16 Replies Last reply
    0
    • A AbdelrhmanRaafat

      I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      If I were developing the application, I'd avoid using an ORM altogether. I don't like the lack of fine grained control they present and the fact that they largely constrain me to doing things in certain prescribed ways - as soon as I want to do something out of the ordinary, things become a lot harder. Now, as to your question - only you can answer that. We don't know what your application is, what it does, how it scales, etc. You might as well go to your local swimming baths and say "I want to buy a car. A Mercedes, a Volkswagen or a Ford. Which is better and why?"

      This space for rent

      A T 2 Replies Last reply
      0
      • A AbdelrhmanRaafat

        I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Whatever you do, don't use LinqToSql, actually yeah, don't use any of that.

        it ain’t broke, it doesn’t have enough features yet.

        N 1 Reply Last reply
        0
        • A AbdelrhmanRaafat

          I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          I'm with Pete. What would you actually gain by using any of them? "Use the right tool for the right job." -- Scotty et al. ORMs can be likened to a pneumatic nail gun -- very useful when building a house, not very useful for building a bird house and completely wrong for constructing an electronic circuit. Always consider your application and its needs on its own, don't simply make it match what some other developer did for some other application which may have absolutely no bearing on what your current application needs to do. None of the applications I have ever developed would have benefited from using an ORM, or "entities", or "custom data objects". I doubt even ten percent of the applications out there really benefit from their use.

          B 1 Reply Last reply
          0
          • A AbdelrhmanRaafat

            I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

            K Offline
            K Offline
            Kevin Marois
            wrote on last edited by
            #5

            I'm using nHibernate now and I don't like it.. for the very same reasons Pete pointed out. I've always been a big fan of Linq-To-Sql.. for the very same reasons Pete pointed out.

            If it's not broken, fix it until it is

            1 Reply Last reply
            0
            • A AbdelrhmanRaafat

              I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

              D Offline
              D Offline
              Duncan Edwards Jones
              wrote on last edited by
              #6

              Use the repository pattern and you can swap in/out ORM to suit yourself.

              1 Reply Last reply
              0
              • P Pete OHanlon

                If I were developing the application, I'd avoid using an ORM altogether. I don't like the lack of fine grained control they present and the fact that they largely constrain me to doing things in certain prescribed ways - as soon as I want to do something out of the ordinary, things become a lot harder. Now, as to your question - only you can answer that. We don't know what your application is, what it does, how it scales, etc. You might as well go to your local swimming baths and say "I want to buy a car. A Mercedes, a Volkswagen or a Ford. Which is better and why?"

                This space for rent

                A Offline
                A Offline
                AbdelrhmanRaafat
                wrote on last edited by
                #7

                My Application is a an MVC web application

                P U 2 Replies Last reply
                0
                • A AbdelrhmanRaafat

                  My Application is a an MVC web application

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  So you've said you want the red car. That tells you nothing about your application other than the platform you want it to run on. In order for YOU to answer your question, you are going to have to actually break down your requirements. Never, ever start from the point of "I want to use this technology". Instead, you start from the point of view, "I have these requirements X, Y and Z. What technology will best serve those requirements and won't constrain me to use only A, B and C?" In other words, you are asking the wrong questions. Go back and start again.

                  This space for rent

                  P 1 Reply Last reply
                  0
                  • A AbdelrhmanRaafat

                    I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    MSDN offers a good comparison for their (MS) technologies. Please do not use Linq to Sql. Your product inheritors will thank you for it. Introducing LINQ to Relational Data[^]

                    Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet. The interesting thing about software is it can not reproduce, until it can.

                    1 Reply Last reply
                    0
                    • P Pete OHanlon

                      So you've said you want the red car. That tells you nothing about your application other than the platform you want it to run on. In order for YOU to answer your question, you are going to have to actually break down your requirements. Never, ever start from the point of "I want to use this technology". Instead, you start from the point of view, "I have these requirements X, Y and Z. What technology will best serve those requirements and won't constrain me to use only A, B and C?" In other words, you are asking the wrong questions. Go back and start again.

                      This space for rent

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      Pete O'Hanlon wrote:

                      So you've said you want the red car.

                      Or... "I want to cruise up the coast to Santa Barbara with my girlfriend. My girlfriend never packs light. Should I drive a Mack truck or a Peterbilt? A cab-over or a conventional?" :doh:

                      S 1 Reply Last reply
                      0
                      • L Lost User

                        Whatever you do, don't use LinqToSql, actually yeah, don't use any of that.

                        it ain’t broke, it doesn’t have enough features yet.

                        N Offline
                        N Offline
                        Nish Nishant
                        wrote on last edited by
                        #11

                        Is LinqToSql even actively developed any more?

                        Regards, Nish


                        Website: www.voidnish.com Blog: voidnish.wordpress.com

                        1 Reply Last reply
                        0
                        • A AbdelrhmanRaafat

                          I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                          N Offline
                          N Offline
                          Nish Nishant
                          wrote on last edited by
                          #12

                          If you are using ASP.NET MVC, Entity Framework would be the recommended ORM framework.

                          Regards, Nish


                          Website: www.voidnish.com Blog: voidnish.wordpress.com

                          1 Reply Last reply
                          0
                          • A AbdelrhmanRaafat

                            I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                            J Offline
                            J Offline
                            Jorgen Andersson
                            wrote on last edited by
                            #13

                            The question you should ask yourself is, which technology is most likely to land you the next job. What, me cynical? :-\

                            Wrong is evil and must be defeated. - Jeff Ello

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              Pete O'Hanlon wrote:

                              So you've said you want the red car.

                              Or... "I want to cruise up the coast to Santa Barbara with my girlfriend. My girlfriend never packs light. Should I drive a Mack truck or a Peterbilt? A cab-over or a conventional?" :doh:

                              S Offline
                              S Offline
                              Slacker007
                              wrote on last edited by
                              #14

                              Model T versus a 2016 whatever. I'll take the 2016 whatever, thank you. :)

                              1 Reply Last reply
                              0
                              • A AbdelrhmanRaafat

                                I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                                P Offline
                                P Offline
                                paulcookie
                                wrote on last edited by
                                #15

                                I have previously written applications that don't use ORM, but did use it in a recent project. I disagree with most of the others, in that I found it very beneficial to use. It doesn't stop you doing other stuff if you need to, but makes many aspects of database interaction much, much easier. In my case it was the entity framework I used.

                                Cookie

                                1 Reply Last reply
                                0
                                • A AbdelrhmanRaafat

                                  I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                                  L Offline
                                  L Offline
                                  Layinka
                                  wrote on last edited by
                                  #16

                                  Never use Linq to SQL. If you are developing in ASP.Net MVC, i think you can use Entity Framework 6 or 7. ORMS have really gotten better in the past few years, and there is not a lot you can't do with them. EF7 infact has improved performance comprd to 6 but still has some missing features.

                                  1 Reply Last reply
                                  0
                                  • A AbdelrhmanRaafat

                                    I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                                    P Offline
                                    P Offline
                                    Petr T
                                    wrote on last edited by
                                    #17

                                    Some time ago, I would recommend NH + NHibernate.Linq[^]. However, I don't have enough experience with EF, so I suggest to read the two articles below and perhaps give a try to both (NH, EF) and then decide which suits your needs and taste better. * Entity Framework 6 vs NHibernate 4[^] * Entity Framework 6 (7) vs NHibernate 4: DDD perspective[^]

                                    1 Reply Last reply
                                    0
                                    • A AbdelrhmanRaafat

                                      I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                                      S Offline
                                      S Offline
                                      Searril
                                      wrote on last edited by
                                      #18

                                      What's with all the LinqToSQL hatred?

                                      B 1 Reply Last reply
                                      0
                                      • A AbdelrhmanRaafat

                                        I want to use one of the 3 ORM options (NHibernate, EntityFramework and LinqToSql) in my application which one is the better? and what is the advantages of it over than others?

                                        E Offline
                                        E Offline
                                        Eric Whitmore
                                        wrote on last edited by
                                        #19

                                        I have used both Entity Framework and NHibernate extensively. I would say that if you are using the ASP.NET 5 (ASP.NET CORE) technology then EF7 is a good tool but if you aren't using the cutting edge ASP.NET tech then I prefer NHibernate but EF 6 will work as well. Please note, EF7/ASP.NET 5 (CORE) are not out of beta yet... Like others have pointed out, this also depends on your project. From my recollection, NHiberante has the ability to connect to a lot more data providers so if you need to integrate with MySQL, MsSQL, Oracle, etc. in the same project then NHiberante might be a better choice. Food for though

                                        Eric

                                        U 1 Reply Last reply
                                        0
                                        • P Pete OHanlon

                                          If I were developing the application, I'd avoid using an ORM altogether. I don't like the lack of fine grained control they present and the fact that they largely constrain me to doing things in certain prescribed ways - as soon as I want to do something out of the ordinary, things become a lot harder. Now, as to your question - only you can answer that. We don't know what your application is, what it does, how it scales, etc. You might as well go to your local swimming baths and say "I want to buy a car. A Mercedes, a Volkswagen or a Ford. Which is better and why?"

                                          This space for rent

                                          T Offline
                                          T Offline
                                          thund3rstruck
                                          wrote on last edited by
                                          #20

                                          I went through the OR/M craze for a few years too before switching back to standard DataLayer models. The biggest issue for us is that ORMs have direct access to tables and generate Non-optimized SQL code that can be difficult to monitor and tune and as soon as you want to do something out of the ordinary, the complexity skyrockets. We have since moved back to the model where all access to data routes through Stored Procedures, which restrict access, creates audit trails, and santitizes input.

                                          U B Z 3 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups