• jacksilver@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    3 小时前

    Object Relational Mapping can be helpful when dealing with larger codebases/complex databases for simply creating a more programmatic way of interacting with your data.

    I can’t say it is always worth it, nor does it always make things simpler, but it can help.

    • bort@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      23 分钟前

      the problem with ORM is that some people go all in on it and ignore pure SQL completely.

      In reality ORM only works well for somewhat simple queries and structures, but at some times you will have to write your own queries in SQL. But then you have some bonus complexity, that comes from 2 different things filling the same niche. It’s still worth it, but there is no free cake.

    • trxxruraxvr@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 小时前

      I don’t have a lot of experience with projects that use ORMs, but from what I’ve seen it’s usually not worth it. They tend to make developers lazy and create things where every query fetches half the database when they only need one or two columns from a single row.