[Qt-interest] Qt5 and SQL
Andre Somers
andre at familiesomers.nl
Wed May 18 14:38:00 CEST 2011
Op Wo, 18 mei, 2011 2:28 pm, schreef Jason H:
> While I absolutely despise [N]Hiberbate, it sounds like that is what you
> are asking for.
There are alternatives out there, but none of them implement what I'd like
to see for Qt.
> I think a QHibernate could be cool, and we could improve on the hibernate
> at the
> same time. For instance, I despise Hibernate because it violates DRY
> principals.
> It requires a XML definition and a code (object) definition, not to
> mention the actual change to the source.
I did not study Hibernate much, but I have looked at a few ORM systems
before. I don't think defining the structure in an XML file is wrong, but
that should then lead to code generation. You should not need to implement
the same structure yourself again.
> If we could use QMetaObject to construct the object
> definition at run- or compile- time, then we'd have a less despicable
> version.
Please, no. Don't make this depend on QMetaObject. Having to have all your
data objects be QObjects makes all this stuff *way* too heavy weight. Nice
if you can make it generate QObjects when that is reasonable, but please
don't force it on people.
> (Basically I imagine a file to have a field type preference and lay out
> the relational structure, like the *.hbm.xml files, but we could run it
> through a
> proxy generator or QMetaObject would create a meta type and register it at
> run time.)
I came to the conclusion that compile time code generation is the only
scalable and flexible solution I could see. But perhaps I overlooked some
things.
André
More information about the Qt-interest-old
mailing list