Hacker News new | ask | show | jobs
by masklinn 3480 days ago
ORM is a tool to map an object model (with which the developer interacts) onto a relational one, the R part is the one which ORMs try to hide, not the one they're trying to surface.
1 comments

> ORM is a tool to map an object model

No, ORM means Object Relational Mapper. if your ORM doesn't support relations between tables, then it is not a ORM.

Given a relationship between 2 tables, an ORM will at the very least fetch related records when rows from a table are loaded.

> godb does not manage relationships like Active Record or Entity Framework,

Godb is therefore NOT an ORM. The title is misleading. People can't just make up definitions like that. It's either an ORM or it is not.

Godb looks like a simple query builder.

Relational comes from Relation which means "table", not relationship.

There's no relationship between 2 tables. You're probably referring to foreign keys, but these are just constraints, not relationships in the sense you're alluding in your comment.

While that may be true in the definition of a relational database, that is not generally what is meant by an ORM. The relationships between objects are a key part of what an ORM would provide.
Actually it's exactly what is meant by ORM.

Object Relational Mapper: It maps Objects to Relations.

Everything else is just auxiliary functionality.

Although I get what you're saying, and indeed the facility you describe is very convenient, it's not what the term means.

I'm just pointing that out because obviously people conflate relation(which comes from relational theory) with relationships.

Relation DOES NOT mean table. Relation does mean relations in the context of the Entity/Relationship model. It has nothing to do with tables, at all. So you are partially right technically I should have used the word entity, not table. But relation does not mean table again.
No. It would obviously be called Objection Relationship mapping and not relational.

This is really RDBMS 101 and we do have specific names and terms for a reason, please do not conflate them and don't confuse other people.

When you will go to https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_mo..., you will see that it doesn't even mention ORMs.

Now go to https://en.wikipedia.org/wiki/Object-relational_mapping.

Read the "challenges" section that points to https://en.wikipedia.org/wiki/Object-relational_impedance_mi....

Now I'll just quote this:

<<The object-relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being served by an application program (or multiple application programs) written in an object-oriented programming language or style, particularly because objects or class definitions must be mapped to database tables defined by relational schema.>>

Open any DBMS book. Pick one at random and read the definition of a "relation". It's always going to be "table".

Alternatively, go to the most(?) popular ORM framework in the world and read this page http://hibernate.org/orm/what-is-an-orm/

More: https://www.fullstackpython.com/object-relational-mappers-or...

<<An object-relational mapper (ORM) is a code library that automates the transfer of data stored in relational databases tables into objects that are more commonly used in application code.>>

I could go on for hours, you get the idea.

Still doesn't make Godb an ORM.
> Godb is therefore NOT an ORM. […] Godb looks like a simple query builder.

Yeah I already said that: https://news.ycombinator.com/item?id=13184341