That seems a perfectly fine way to go about things, there is no "right
way". Also, docs could have multiple "types",
{"types":["contact", "vendor", "enemy"], "name":"Bill Gates", ...}
On Mar 26, 2008, at 12:36 AM, Chris Anderson wrote:
On Tue, Mar 25, 2008 at 8:23 PM, Jan Lehnardt <[EMAIL PROTECTED]> wrote:
On Mar 25, 2008, at 23:05 , Sho Fukamachi wrote:
Has the community arrived at a kind of "best practise" for
differentiating between record types? In the wiki using the key
"type" is suggested, I am wondering how official this is. Not that
it needs to be official, of course, but establishing some sort of
convention is probably a good idea to get everyone on the same page.
My practice doesn't lend itself to convention directly, but has worked
well for me so far. Rather than specifying a document.type, I just use
Duck typing, like a good Rubyist. :)
For instance in a view I might say
if (doc.authors) {
... iterate through the authors and map them ...
}
This way documents don't have fixed types, they just have certain view
functions that apply to them. It's too soon to tell if this will
become a maintenance headache, but I think as long as my writers are
consistent, I'll do just fine with it.
--
Chris Anderson
http://jchris.mfdz.com