Sat Oct 06 2012 19:44:51 GMT+0400 (Caucasus Standard
Time) пользователь Jeroen De Dauw (jeroendedauw(a)gmail.com) написал:
Starting a new thread as this is really not related to the Wikidata review
On 6 October 2012 08:51, Dmitriy Sintsov <questpc(a)rambler.ru> wrote:
Speaking of ORM, are there the plans to
support table field relations (one
> to one, one to many, many to many) and maybe to use ORM through the core
> and another extensions? This could make DB access cleaner and simplier
> however maybe with little overhead. Also index hinting is probably required
> in such case, especially for such large and actively accessed databases.
The existing ORMTable functionality I wrote is intended as a very simple
and lightweight layer on top of the regular database abstraction MediaWiki
has. It is not a fully fledged ORM framework and is not intended to be one.
I think it's a very bad idea to try to turn it into one. If you really want
something more like a full object relational mapper, then you'll be better
of starting from scratch after putting some serious thought into how you're
going to do it. I do suspect that most core developers (including me) will
be rather sceptical of putting such a thing into core though, as it would
seriously impact a lot of existing code.
Many frameworks allow to combine "direct" SQL calls and ORM calls, so
there is not that big legacy compatibility problem.
The efficiency could be a problem, though. Not all of ORM's are heavy-weight. For
example, Yii's is quite light however queries weren't always most efficient. I
used to work with Yii recently, that's why I asked. Speaking of Java, that's more
heavy-weight, something like Doctrine, probably (which I didn't use yet).