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 about the pattern in general.
Sent from my Android phone. On 28 Aug 2012 01:10, "Victor Vasiliev" vasilvv@gmail.com wrote:
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 begin introducing the pattern.
Personally, I'm a big fan of consistency and since we don't use ORM anywhere else, I'm hesitant to begin using a new design pattern here (and I'm not entirely convinced why it's *needed*). On a more philosophical level, I personally don't like ORM because I think it needlessly abstracts data access in a more confusing way--but my personal feelings can be forgotten if people think this actually makes more sense.
However, I may be in the minority here, and my fears are unfounded. I would love some feedback from everyone about whether ORM in the sites code (and more generally, in core) is a good idea.
Thoughts?
-Chad
[0] https://gerrit.wikimedia.org/**r/#/c/14295/https://gerrit.wikimedia.org/r/#/c/14295/
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
Could you give an example of how ORM looks like / would look in MW code?
—Victor.
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l