-1

I'm building a model of the SQL query language.

It doesn't attempt to abstract SQL at all - instead, it tries to model it directly, so it has model objects named Query, Table, Column, Variable, Expression, Join, etc.

Contrast this with an object/relational mapper, which tries to abstract away SQL and the DBMS in favor of some new/different and (usually) higher-level abstractions.

My question is regarding the terminology to describe what I'm writing: generally, is a model always an abstraction? Is an abstraction always a model? Are they synonymous, more or less?

Specifically, is a model of SQL also an abstraction, or is it correct to describe it as just a model?

gnat
  • 21,442
  • 29
  • 112
  • 288
mindplay.dk
  • 1,677
  • 2
  • 11
  • 13
  • possible duplicate of [What is abstraction?](http://programmers.stackexchange.com/questions/16070/what-is-abstraction) – gnat Dec 13 '15 at 19:07
  • @gnat I read the accepted response to that question, and it resounds with my understanding of abstraction. But it doesn't resolve my question. In a nutshell, what is the difference between a model and an abstraction? Is one a superset of the other? – mindplay.dk Dec 15 '15 at 13:24

1 Answers1

2

This is highly philosophical, but:

A model is definitely an abstraction if it is trying to represent real-world entities, in which case, of course you cannot have cars, trees, houses etc. living inside the computer, so obviously, you are abstracting.

But if the model is not trying to represent a real-world entity, and instead it is a one-to-one mapping to already abstract entities, then I think it can safely be called a model, without the need to add the "abstraction" part.

However, the reasons to go one way or the other are trifling.

Mike Nakis
  • 32,003
  • 7
  • 76
  • 111
  • Does a model have to model a real-world entity? In this case, my domain is SQL, so the entities I'm modeling are Query, Condition, Join, etc. - even if those are already abstract entities (translating to an execution plan against physical data on a disk at a lower level) in terms of the domain I'm modeling, those are my entities, is that correct? – mindplay.dk Dec 15 '15 at 13:22
  • @mindplay.dk yes, of course, that's exactly what I am talking about, you may be modelling *already abstract* entities! so, you have a *model*, not an *abstract model*. – Mike Nakis Dec 15 '15 at 20:33