[erlang-questions] How to code against an interface rather than an implementation?

Eric Moritz <>
Tue Aug 13 17:46:07 CEST 2013


I have found that making a generic interface for my projects tends to be a
premature optimization and unless the project needs swappable databases, a
proxy module tends to be overkill.

The approach I take is to write a module that has an API that hides the
details of the implementation.

That way in the future, if the need arises, I can completely rewrite the
implementation without having to refactor the clients of the API.  I can
add connection pooling, or completely replace the database with something
else.

Eric Moritz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130813/6cec0d05/attachment.html>


More information about the erlang-questions mailing list