www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - how to resolve "object-relational impedance mismatch" using D

reply Gour <gour atmarama.net> writes:
Hello!

We're considering what would be the optimal way way to resolve
"object-relational impedance mismatch" problem in our application which
we would like to write using D language.

Considering it's planned to be multi-platform desktop GUI app and have
extensive research capabilities available for learning & studying
purposes - it means to be able to put queries against the whole database
of available data - we are thinking that using embedded database -
sqlite3 -  as application's natural storage format would be a nice fit.
Sqlite3 offers robust format available for multiple platforms.

Moreover, having RDBMS could greatly simplify the code handling all
kinds of queries againsta the data which would be required to write
otherwise.

Otoh, here we come to the well-known "object-relational impedance
mismatch" problem and wonder how to resolve it, iow.:

a) we are not aware of any ORM available for D, so using relational data
model + D with its OOP paradigm, means to resolve the mismatch by hand
by writing required ORM

b) use relational model "as it is", leave OOP (in D) behind, but we
wonder whether such approach makes sense in the language which is
higher-level than C. (E.g. Fossil SCM written in C uses sqlite3 as
storage format.)

c) several papers/posts which we read before and recently (like
"Functional-Relational Impedance Match" Eric Meijer's The Confessions of
a Used Programming Language Salesman) tend to suggest that using
relational data model goes better with FP languages or that the latters
can overcome the above mismatch problem better, which would lead to
putting D's FP capabilites to extreme or

d) something else?


I can provide more details about the nature of the problem or
application's specification if required, but we also wonder how to
resolve it in general using D which advertises as "offers classic
polymorphism, value semantics, functional style, generics, generative
programing, contract programming, and more =E2=80=94 all harmoniously
integrated"?=20


Sincerely,
Gour

--=20
One who restrains his senses, keeping them under full control,=20
and fixes his consciousness upon Me, is known as a man of=20
steady intelligence.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Feb 22 2012
parent reply "Kagamin" <spam here.lot> writes:
Application spec is one thing, ORM spec is another.
Feb 22 2012
parent Gour <gour atmarama.net> writes:
On Wed, 22 Feb 2012 19:46:59 +0100
"Kagamin" <spam here.lot> wrote:

 Application spec is one thing, ORM spec is another.
Sure. Considering that there are no ORM for D, afaik, I'm interested what would be wise to do in D, in a genaral case when one has relational data model: a) usee OOP in D and try to write/use some ORM to solve impedance problem b) use relational model and (probably) just write procedural code c) attempt to write more FP code which might be better marriage between relational model and the code or d) something else? If you believe that the answer is too dependant on the application spec, I might provide it, but wanted to spare the audience from many possibly not relevant details. Sincerely, Gour --=20 Therefore, without being attached to the fruits of activities,=20 one should act as a matter of duty, for by working without=20 attachment one attains the Supreme. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Feb 22 2012