From: parkerjwik <jos...@ho...> - 2013-08-09 09:05:32
|
Hi, looking for some feedback on design pattern. Site has two basic types of pages: articles (content - unstructured/annotated bodies of text) and topics (containers for structured data) Topics have types, ie. property sets. And articles link to topics. Topics then relate articles, by aggregating references to given topic. So, couple of approaches considered, the first rejected in favor of the second: 1. topics have single type, and articles look something like this: blah, blah [[person::joe]] wrote an essay, [[essay::fragglerock]] about ... Here, properties "person" and "essay" would automatically create topical pages with there respective forms, via "creates pages with form" metaproperty. Users can then edit topic pages later. The problem here is that topics may have many types, eg. fragglerock is also a tv show(problem of composition), joe is also an author(problem of inheritence/inference), etc. (Note, this is not a just a name conflict problem that can be solved with namespaces.) 2. topics have multiple types, and articles look something like this: blah, blah [[topic::joe]] wrote an essay, [[topic::fragglerock]] about... Here, topical pages are created and initially edited with a generic form/template. it has a field/property type, which is gets one or more values. Each value links to separate form to edit properties associated with that particular type. Still some issues with how exactly to handle inheritence/inference, but multiple type problem is solved. The basic template pattern looks like this: (simplified for clarity) --------------------------------- Some article blah, blah [[topic::joe]] wrote an essay, [[topic::fragglerock]] about... --------------------------------- Property:Topic [[Creates pages with form::Topic]] --------------------------------- Category:Topic [[Has default form::Topic]] --------------------------------- Form:Topic {{{for template|Topic}}} {| class="formtable" {{{field | type | input type=dropdown | values=Type A, Type B, Type C}}} |} {{{end template}}} --------------------------------- Template:Topic {{#arraymap:{{{typ|}}}|,|x|{{add type|x|{{PAGENAME}}}} }}<br> [[Category:Topic]] --------------------------------- Template:Add type {{#formlink:form={{{1}}} |target={{{2}}} |link text={{{1}}} }} --------------------------------- Form:Type A {{{for template|Type A}}} {| class="formtable" {{{field | X}}} |} {{{end template}}} --------------------------------- Template:Type A [[X::{{{X|}}}]] --------------------------------- Form:Type B {{{for template|Type B}}} {| class="formtable" {{{field | Y}}} |} {{{end template}}} --------------------------------- Template:Type B [[Y::{{{Y|}}}]] --------------------------------- clear? good/reasonalble approach? better/alternative ways to acheive what i am after? Thanks, Josh -- View this message in context: http://wikimedia.7.x6.nabble.com/multiple-forms-for-single-page-a-good-way-to-implement-composition-and-inheritance-tp5010816.html Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com. |