[erlang-questions] Code structure for webmachine/cowboy with versioned API
Mon Mar 7 14:16:23 CET 2016
Jesper Louis Andersen <jesper.louis.andersen@REDACTED> writes:
> [ text/plain ]
> On Mon, Mar 7, 2016 at 8:49 AM, Torben Hoffmann <thoffmann@REDACTED> wrote:
>> If I dispatch to a version generic handle module I can - potentially -
>> reuse code that is common across api versions.
> Can you map API version 1 into API version 2 in any way? If so, a way to
> handle the problem is simply to shim Version 1 and transform it to a
> Version 2 query and then run with the handler of Version 2.
Well, I don't know what version 2 will look like yet :-)
I will add a dispatch rule that forwards version 1 specifically to my
current handler module.
Then I can deal with the choice of approach for version numbers when it
is time to do that new version.
Future me is going to hate present me... but present me will document
the considerations as comments.
M: +45 25 14 05 38
More information about the erlang-questions