component / model

Minimalistic extensible data models
122 stars 40 forks source link

expose .proto and .statics #44

Closed yields closed 10 years ago

yields commented 11 years ago

i want to extend those.

domachine commented 11 years ago

why? i think there's nothing wrong with

var proto = require('model/lib/proto');
...

since require caches the lookup you always receive the same object.

yields commented 11 years ago

yeah sure, but i think it's much cleaner.

var proto = require('express/lib/application');
var proto = require('express').application;
ianstormtaylor commented 11 years ago

agree that reaching into the dir structure of the component is bad, since its private.

curious whats the extending use case? shouldn't you just use .use()?

yields commented 11 years ago

hm, mainly overriding .url(), doing that in a plugin will be a PITA imho.

ianstormtaylor commented 10 years ago

shouldnt need to do this, can just edit Model.url and Model.prototype.url directly