On Mon, Dec 29, 2008 at 4:09 PM, Antony Blakey <[email protected]> wrote:
>
> And as far as writing is concerned, using name identity for values that
> appear in multiple contexts makes it easier to write polymorphic code e.g. a
> function that extracts the document id and revision from either a view row
> or the document value (possibly) contained within.
>

Which is exactly the thing I like about only having _id and _rev in
documents. My being able to identify CouchDB documents by duck type is
something I've come to enjoy in my coding. I think it makes for
simpler applications in places. Splattering the world with meaningless
"_id"s and "_rev"s only makes things more complicated.

Polymorphic identity has it's place, but you really shoudn't have an
_id / _rev pair on your hands, unless you've also got the document
itself. Breaking that contract will produce muddled thinking about
Couch's MVCC.

-- 
Chris Anderson
http://jchris.mfdz.com

Reply via email to