Analogy between POO and database

Asked

Viewed 128 times

2

I’ve been reading about the Entity Framework, that it has some features of transforming classes into tables and objects into lines. I found it super interesting!

To what extent is this analogy valid? If so, then what would be the analogue of a BD interface?

And what would be, in POO, the analogue of a bridge table?

Does it make sense to extend that analogy, or not?

1 answer

2


If so, then what would be the analogue of a BD interface?

Nothingness.

And what would be, in POO, the analogue of a bridge table?

There is nothing special about it. The most that can occur, but usually not quite so, is that a array be used to link between the tables that relate.

Does it make sense to extend that analogy, or not?

No, nothing to do with.

The only thing EF does is to take the class fields with their attributes and create a table in the database according to this specification, nothing more than this.

It operates in essence on anemic models. Not that you can’t behave in the class, but they will be ignored when transposing into the database.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.