[Interest] An alternative reflection system and a new ORM Library

Michael Dougras da Silva micdoug.silva at gmail.com
Mon Aug 11 00:58:35 CEST 2014


Hi,

 

My name is Michael and I am a Computer Science student. I met Qt one year
ago and I decided to use it in my last work.

When studying Qt I realized that the Object Relational Mapping libraries
that exist for use with it are so difficult to use for people who doesn’t
have much experience in C++ programming, like me.

So I decided to try to develop an ORM library that uses only Qt and C++
standard features, and that uses a system of metadata based on annotations
or something similar.

Since then, I study the Qt framework and the new C++ 11 specification. 

 

On the last month I started developing the library and I finished developing
its first version now. 

The library uses a reflection system that permits access metadata related to
the class and the properties (attributes) that it has, and also permits
access and adjust the values of the properties.

The reflection system permits access private, protected or public
properties. It doesn’t matter if they have getter and setter methods.

This is possible because I export lambda expressions that returns a
reference to the internal properties of the mapped classes. This lambda
expressions are organized in a structure that permits add, replace and
remove of metadata.

The lambda expressions are exported by a function named “reflection” that
are generated through the use of macros that simulates the annotations
system.

The reflection system doesn’t use inheritance.

 

The library can execute insert, update, delete, select, select count(*) and
create table, but only works with simple classes (no inheritance yet) and
doesn’t support relations yet.

I am testing the library in Windows (msvc2013 and mingw4.8) and in Linux
(g++4.8).

 

I made two videos that show the use of the reflection system and the
database operations.

The reflection system: https://www.youtube.com/watch?v=b3b3906Z1_Y
<https://www.youtube.com/watch?v=b3b3906Z1_Y&list=UUk6f07vUxXGBMGMs03ZNmhA>
&list=UUk6f07vUxXGBMGMs03ZNmhA 

The storage layer: https://www.youtube.com/watch?v=kbbbVWakAMM
<https://www.youtube.com/watch?v=kbbbVWakAMM&list=UUk6f07vUxXGBMGMs03ZNmhA>
&list=UUk6f07vUxXGBMGMs03ZNmhA

 

I can’t test the library in the Mac OS environment. Could anybody test the
library in this OS for me, please?

What do you think about this system of reflection (the export of lambda
expressions)?

 

The project source code can be found at
https://www.github.com/micdoug/orm4qt

The code has 3 projects:

-          A example project that uses a class mapped and gui interface

-          A unit test project that tests the reflection system

-          The ORM itself

 

Sorry if I wrote something wrong. I am learning English yet.

 

Atenciosamente,

Michael Dougras da Silva

 

"Nada é tão difícil que, à força de tentativas, não tenha resolução."
(Terêncio)

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140810/42cf5255/attachment.html>


More information about the Interest mailing list