Hacker News new | ask | show | jobs
by gamache 3433 days ago
It's a shame so many people think of the Data Access Object design pattern as something only Java developers should be using. Using DAOs to provide database-agnostic access to your data takes a few moments more at first, but then when you need to move data from $DB_X to $DB_Y, there's a lot less wailing and gnashing of teeth.

Mediocre link on the topic: https://en.wikipedia.org/wiki/Data_access_object

1 comments

I'm not sure what your point is. Do you mean that if only people used DAOs then Parse shutting down wouldn't be a problem? It only encapsulates the problem. You still need to go through a process to switch from Parse to MariaDB or whatever else you switch to. You just don't have to rewrite your whole application.

I'm in favor of DAOs and use them myself but they don't have anything to do with what I was talking about.

You made the point that the tradeoff can bite you. I mentioned DAOs as a way to make that bite less painful. Not a hard connection to make.
That's what I assumed, but it wasn't totally clear that was your intention.

Like I said it does help but it's not a panacea.