couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Landolt" <d...@deanlandolt.com>
Subject Re: How to organize/differentiate Documents?
Date Wed, 16 Jul 2008 15:50:08 GMT
> Duck typing will go a long way here.
>
> function(doc) {
>  if (doc.wheels && doc.engine) {
>  //I'm a vehicle
>  } else if (doc.wheels && doc.pedals) {
>  // I'm a bike
> }
> }
>

That seemed to be what Troy was hinting at with his example as well. I guess
explicit inheritance doesn't matter much when you're just storing the
attributes and not the methods. Thanks for the insight.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message