We use duck typing, which is very javascript-y. When we had strict typing,
we ended up building an inheritance mechanism for our views. Down-side is
that property names within a given database are global.

A

On Thu, Nov 12, 2009 at 1:40 PM, Robert Campbell <[email protected]> wrote:

> I'm reading CouchDB in Action and they make use of a doctype in their
> examples. This doctype attribute is used in your Map functions to
> easily filter out the specific types you want. Example:
>
> if (doc.doctype == "User") // we have a user...
>
> CouchDB: A Definitive Guide, on the other hand, makes use of duck
> typing. Essentially you determine that a document is a duck if it
> quacks and flies:
>
> if (doc.quacks && doc.flies) // Looks like a duck..
>
> What are the pros and cons of each approach? Which one do you guys use and
> why?
>

Reply via email to