makesites / brisk

Automation for Express.js #express.js #javascript
3 stars 1 forks source link

Improve inheritance #26

Closed tracend closed 11 years ago

tracend commented 11 years ago

The method getClass is currently the main method to get the parent class when extending any controller/model

The scope of this feature needs to be broaden and specialised based on the type of class.

So for example we might have:

var NewController = brisk.getController("main")

var NewModel = brisk.getModel("base")

These methods may be focused requests of the more generic getClass(), in which case the equivalent syntax would be:

var NewController = brisk.getClass("controllers/main")

var NewModel = brisk.getClass("models/base")

getClass should lookup in all paths using findPath instead of expecting everything in the default location. This means the class may live either in app folder, in a plugins folder or in the default folder - with that priority order.

tracend commented 11 years ago

In addition, limiting the lookup to the default (base) folder would be desirable in some cases.

var NewController = brisk.getBaseController("main")

var NewModel = brisk.getBaseModel("base")
tracend commented 11 years ago

Closing as addressed