Re: [Wikitech-l] Using ORM patterns in core

2012-08-28 Thread Chad
On Tue, Aug 28, 2012 at 12:12 AM, Aaron Schulz aschulz4...@gmail.com wrote: The idea of some base classes for CRUD and API/Pager table listings is fine. It can obviously avoid inconsistency among the DAOs. If these classes are called ORM*, I guess that's OK too, as longs as they don't scope

[Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Chad
Hi, It's recently come up in some of the Wikidata changes proposed to core to start using some ORM-like interfaces for accessing this data[0]. Since we don't use ORM-style access anywhere else in core, I figured it warranted some wider discussion before we begin introducing the pattern.

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Tyler Romeo
From what I can tell, MediaWiki is trying more and more to reduce code re-use and move toward an easy MVC design, where the models are handled by ORM, the controllers are either Actions or SpecialPages, and the views are handled by Skin/Message/HTMLForm. And while ORMTable and FormAction, etc. are

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Jeroen De Dauw
Hey, I'm a big fan of the pattern (or at least parts of it), which is the reason I spend quite some effort getting a generic interface into MediaWiki. This is the ORMTable class mentioned by Tyler. Documentation of this class, together with a rationale and some implementation notes can be found

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Antoine Musso
Le 27/08/12 22:53, Chad wrote: It's recently come up in some of the Wikidata changes proposed to core to start using some ORM-like interfaces for accessing this data[0]. Since we don't use ORM-style access anywhere else in core, I figured it warranted some wider discussion before we begin

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Victor Vasiliev
On 08/27/2012 04:53 PM, Chad wrote: Hi, It's recently come up in some of the Wikidata changes proposed to core to start using some ORM-like interfaces for accessing this data[0]. Since we don't use ORM-style access anywhere else in core, I figured it warranted some wider discussion before we

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Jeroen De Dauw
There are some examples linked from the documentation here: https://www.mediawiki.org/wiki/Help:ORMTable Note that these are not clean examples as they contain unrelated code as well. And of course this is just one example of how you can go about implementing an ORM pattern, while this tread is

Re: [Wikitech-l] Using ORM patterns in core

2012-08-27 Thread Aaron Schulz
I was just looking through those classes again. I think ORMRow is generally OK, since it's mostly a simple CRUD wrapper to deal with some of the busy-work of making data access objects. I don't really get the summary (updateSummaries/inSummaryMode) stuff though. I guess the callers/subclasses do