Hacker News new | ask | show | jobs
by mackwic 4131 days ago
Ok, after a lookup, "persistence ignorance" is the ability to have implicit save of the models when things change.

Bookshelf has events, which make very easy to wire some kind of persistence ignorance (we implement it in our base Model class).

1 comments

I would expect those events to be triggered by action though, then it wouldn't be persistence ignorance.
Sequelize has the build method, which persists automatically.

Couldn't the rest be achieved by simply adding a few (update, delete) methods to the model classes?

The create method on model's persist automatically. Build just creates an instance without saving it to the database.
Really? I thought it was the other way around...