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. ORM Quick Survey

ORM Quick Survey

Scheduled Pinned Locked Moved The Lounge
csharpdatabaselinqhelpquestion
44 Posts 26 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.
  • F Foothill

    I am currently developing my own ORM. I've already completed work on all the key components such as building the database and a (sorta) simple codebase to build applications with it. I've even written a security layer. Once I've got the workflow engine sorted out, I am going to have to find a real world problem to throw it at. I have to thank the folks at Microsoft who built the engine for Operations Manager. After poking around under it's hood for a while, I got the idea to build this little monster. It's a software library that manages it all. With it, I managed to build a password protected file sharing website in a week.

    if (Object.DividedByZero == true) { Universe.Implode(); }

    R Offline
    R Offline
    RickZeeland
    wrote on last edited by
    #20

    I spy with my little eye: a new series of articles coming up :-\

    F 1 Reply Last reply
    0
    • K Kevin Marois

      I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      G Offline
      G Offline
      GuyThiebaut
      wrote on last edited by
      #21

      At home I use EF for the API for my website. I find EF is fine for my purposes. At work we don't have a full ORM but we have our own mapping systems which we have written in-house which, currently, seems to work better for a large complex piece of software with an Oracle database.

      “That which can be asserted without evidence, can be dismissed without evidence.”

      ― Christopher Hitchens

      1 Reply Last reply
      0
      • F Foothill

        I am currently developing my own ORM. I've already completed work on all the key components such as building the database and a (sorta) simple codebase to build applications with it. I've even written a security layer. Once I've got the workflow engine sorted out, I am going to have to find a real world problem to throw it at. I have to thank the folks at Microsoft who built the engine for Operations Manager. After poking around under it's hood for a while, I got the idea to build this little monster. It's a software library that manages it all. With it, I managed to build a password protected file sharing website in a week.

        if (Object.DividedByZero == true) { Universe.Implode(); }

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

        Good luck with this. I agree it is the best way not to depend on a library which change completely (enough) after some months :thumbsup:

        It does not solve my Problem, but it answers my question

        F 1 Reply Last reply
        0
        • R RickZeeland

          I spy with my little eye: a new series of articles coming up :-\

          F Offline
          F Offline
          Foothill
          wrote on last edited by
          #23

          Ha, and get skewered some more for my abuse of the Reflection namespace, I think not. :laugh: All joking aside, I don't know if any of what I am working on can be considered proprietary yet but I do like to be able to build a whole new database for a specific set of data in less than half-an-hour. I can also write code like this to work with it:

          DataObject dObj = dataAccess.Objects.GetDataObject("4e813bca-8fb0-448e-8f01-d714bd8132a3");
          dObj["AnIntegerProperty"].SetValue(42);
          dObj.Update(TransactionContext.Current);

          This code fetches a specific record from a database and then pushes an updated value complete with transaction logging.

          if (Object.DividedByZero == true) { Universe.Implode(); }

          J 1 Reply Last reply
          0
          • L Lost User

            Good luck with this. I agree it is the best way not to depend on a library which change completely (enough) after some months :thumbsup:

            It does not solve my Problem, but it answers my question

            F Offline
            F Offline
            Foothill
            wrote on last edited by
            #24

            While the Entity Framework is great and all, the one thing that really pushed me away from it is how it never optimizes the tables. I was mentored by one of the last few people who earned their SQL Server Master's Certification and he always told me that how you structure your table can have a equal if not bigger performance impact than how you write your queries. It makes perfect sense when you think about if from a database engine point of view. What's the point of simplifying development if your data lives in performance sucking tables.

            if (Object.DividedByZero == true) { Universe.Implode(); }

            1 Reply Last reply
            0
            • K Kevin Marois

              I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

              If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

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

              Is LINQ to SQL actively developed/maintained today?

              Nish Nishant Consultant Software Architect Ganymede Software Solutions LLC www.ganymedesoftwaresolutions.com

              1 Reply Last reply
              0
              • P PIEBALDconsult

                Right, I haven't yet encountered a database access situation that couldn't easily be dealt with by using DataReaders, DataTables, DataViews, DataRows, etc. Microsoft even provides DataAdapters (ptui) for Bob's sake! ORMs are definitely a solution looking for a problem.

                M Offline
                M Offline
                MadMyche
                wrote on last edited by
                #26

                The reason we have ORMs now is because we can't use FPSE to connect our ASP pages to their MSAccess databases


                Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

                1 Reply Last reply
                0
                • K Kevin Marois

                  I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                  K Offline
                  K Offline
                  kmoorevs
                  wrote on last edited by
                  #27

                  Not using one...does that count? I'd rather avoid the abstractions and dependencies. :)

                  "Go forth into the source" - Neal Morse

                  M 1 Reply Last reply
                  0
                  • F Foothill

                    Ha, and get skewered some more for my abuse of the Reflection namespace, I think not. :laugh: All joking aside, I don't know if any of what I am working on can be considered proprietary yet but I do like to be able to build a whole new database for a specific set of data in less than half-an-hour. I can also write code like this to work with it:

                    DataObject dObj = dataAccess.Objects.GetDataObject("4e813bca-8fb0-448e-8f01-d714bd8132a3");
                    dObj["AnIntegerProperty"].SetValue(42);
                    dObj.Update(TransactionContext.Current);

                    This code fetches a specific record from a database and then pushes an updated value complete with transaction logging.

                    if (Object.DividedByZero == true) { Universe.Implode(); }

                    J Offline
                    J Offline
                    Jon McKee
                    wrote on last edited by
                    #28

                    dObj["AnIntegerProperty"].SetValue(42);

                    Not suggesting premature optimization, but if this SetValue ends up causing any bottlenecks you can do the following which works for properties but not fields because of how the values are set internally:

                    class PropertyInfoWrapper
                    {
                    private Action _setValueDelegate;

                    public PropertyInfoWrapper(PropertyInfo property)
                    {
                    MethodInfo delegateHelper = typeof(PropertyInfoWrapper).GetTypeInfo()
                    .GetMethod(nameof(this.CreateDelegate), BindingFlags.Instance | BindingFlags.NonPublic)
                    .MakeGenericMethod(property.DeclaringType, property.PropertyType);
                    _setValueDelegate = (Action)delegateHelper.Invoke(
                    this,
                    new object[] { property.SetMethod });
                    }

                    private Action CreateDelegate(MethodInfo method)
                    {
                    var del = (Action)method.CreateDelegate(typeof(Action));
                    return (object obj, object val) => { del((TObject)obj, (TProp)val); };
                    }

                    public void SetValue(object container, object value) =>
                    _setValueDelegate(container, value);
                    }

                    I've been debating on whether to do an article about my RegexContainer[^] project for a similar reason (where this example is from). There's a lot of dislike for reflection even when it's useful.

                    F 1 Reply Last reply
                    0
                    • K Kevin Marois

                      I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                      M Offline
                      M Offline
                      Mycroft Holmes
                      wrote on last edited by
                      #29

                      Rolled my own in the 90s, rerolled many times since, in 4 different languages. It seems that most devs who are using an ORM have it imposed from management! And they don't seem to be impressed. This thread will be shared with my management :laugh:

                      Never underestimate the power of human stupidity RAH

                      1 Reply Last reply
                      0
                      • K Kevin Marois

                        I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                        J Offline
                        J Offline
                        Jacquers
                        wrote on last edited by
                        #30

                        Entity Framework (.Net Core) - with PostgreSQL. It's what the team uses and so far no major issues with it. In the past I've rolled my own, used Linq to SQL and an older version of EF.

                        1 Reply Last reply
                        0
                        • K Kevin Marois

                          I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                          T Offline
                          T Offline
                          twaindev
                          wrote on last edited by
                          #31

                          LLBLGen Pro, with it's own framework, but it also supports L2S and EF.

                          1 Reply Last reply
                          0
                          • K Kevin Marois

                            I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                            P Offline
                            P Offline
                            Pachangas
                            wrote on last edited by
                            #32

                            Dapper. It's insanely fast and extremely flexible to work with.

                            S 1 Reply Last reply
                            0
                            • P Pachangas

                              Dapper. It's insanely fast and extremely flexible to work with.

                              S Offline
                              S Offline
                              Ste S
                              wrote on last edited by
                              #33

                              +1 for Dapper along with Dapper.Contrib. I actively avoid contracts that state EF as a requirement. I understand for some people it's the dog danglies but I can't see a compelling case to use EF. I know that's just my mileage but I genuinely would like to know why people use EF as opposed to a micro-orm like Dapper or PetaPoco.

                              A 1 Reply Last reply
                              0
                              • K Kevin Marois

                                I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                D Offline
                                D Offline
                                DerekT P
                                wrote on last edited by
                                #34

                                Rolled my own, which of course has developed over various projects. I have looked at NHibernate and EF. Found NHibernate to be badly documented to the point I couldn't (on my own, as a freelancer) actually get anything to work at all. EF was simple enough to get started with, but trying to maintain it without everything breaking was difficult. Even harder when trying to either optimise things or extend functionality. My own seems very easy to maintain/extend, but of course that's because I know every line of code having written them. I guess to an outside it might be tricky and it does require some hand-coding for each object; but it's a very mechanical process involving just 2 lines of code per d/b field, and a couple of constants.

                                1 Reply Last reply
                                0
                                • K Kevin Marois

                                  I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                  R Offline
                                  R Offline
                                  Roman Ivantsov
                                  wrote on last edited by
                                  #35

                                  VITA: https://github.com/rivantsov/vita

                                  1 Reply Last reply
                                  0
                                  • K Kevin Marois

                                    I'm curious as to what ORM you use and why. For personal projects I use Linq to SQL and I love it. It's simple and works all the time. At work we're using Entity Framework and I detest it. It ALWAYS results in compilation errors and almost always generates entities wrong in some way. I'v heard of some folks here using their home rolled ORM's. For those of you, what ORM would yo say it most resembles?

                                    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                    A Offline
                                    A Offline
                                    andegre
                                    wrote on last edited by
                                    #36

                                    Dapper [by Stackoverflow guy(s)]. I love it. Small, straight to the point. I only need it for executing stored procedures, and/or getting results back via stored procedures.

                                    1 Reply Last reply
                                    0
                                    • S Ste S

                                      +1 for Dapper along with Dapper.Contrib. I actively avoid contracts that state EF as a requirement. I understand for some people it's the dog danglies but I can't see a compelling case to use EF. I know that's just my mileage but I genuinely would like to know why people use EF as opposed to a micro-orm like Dapper or PetaPoco.

                                      A Offline
                                      A Offline
                                      andegre
                                      wrote on last edited by
                                      #37

                                      Didn't see your [Dapper] reply before I submitted mine. I use Dapper as well, for the primary reason that you mentioned, it's insanely fast!

                                      1 Reply Last reply
                                      0
                                      • J Jon McKee

                                        dObj["AnIntegerProperty"].SetValue(42);

                                        Not suggesting premature optimization, but if this SetValue ends up causing any bottlenecks you can do the following which works for properties but not fields because of how the values are set internally:

                                        class PropertyInfoWrapper
                                        {
                                        private Action _setValueDelegate;

                                        public PropertyInfoWrapper(PropertyInfo property)
                                        {
                                        MethodInfo delegateHelper = typeof(PropertyInfoWrapper).GetTypeInfo()
                                        .GetMethod(nameof(this.CreateDelegate), BindingFlags.Instance | BindingFlags.NonPublic)
                                        .MakeGenericMethod(property.DeclaringType, property.PropertyType);
                                        _setValueDelegate = (Action)delegateHelper.Invoke(
                                        this,
                                        new object[] { property.SetMethod });
                                        }

                                        private Action CreateDelegate(MethodInfo method)
                                        {
                                        var del = (Action)method.CreateDelegate(typeof(Action));
                                        return (object obj, object val) => { del((TObject)obj, (TProp)val); };
                                        }

                                        public void SetValue(object container, object value) =>
                                        _setValueDelegate(container, value);
                                        }

                                        I've been debating on whether to do an article about my RegexContainer[^] project for a similar reason (where this example is from). There's a lot of dislike for reflection even when it's useful.

                                        F Offline
                                        F Offline
                                        Foothill
                                        wrote on last edited by
                                        #38

                                        The internals aren't really all that complex. The DataObject class only contains a collection of "Properties" that validate their own values when you try to set them. The real bottlenecks are database calls so I can build a little overhead into the classes without any real loss in performance.

                                        Jon McKee wrote:

                                        There's a lot of dislike for reflection even when it's useful.

                                        I don't get this either. With Reflection, you could, in theory, write deep learning algorithms that self-optimize their own code. I approach Reflection like I do C++ code. Since both give you enough rope to hang yourself, you must weight your options and use it when your program benefits from its use or it's absolutely necessary to reach your goal.

                                        if (Object.DividedByZero == true) { Universe.Implode(); }

                                        1 Reply Last reply
                                        0
                                        • K kmoorevs

                                          Not using one...does that count? I'd rather avoid the abstractions and dependencies. :)

                                          "Go forth into the source" - Neal Morse

                                          M Offline
                                          M Offline
                                          MadMyche
                                          wrote on last edited by
                                          #39

                                          BINGO- We have a winner! I use the .Net implementation of ADO to connect C# to SQL Server, and just parallel develop my classes and tables.


                                          Director of Transmogrification Services Shinobi of Query Language Master of Yoda Conditional

                                          1 Reply 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