开发者

What are the differences between the Erlang Web Gateway Interface (EWGI) and Webmachine?

Bot开发者_Go百科h EWGI and Webmachine provide abstractions of HTTP in Erlang. I would like to know what the key conceptual differences are in their approach?


EWGI provides an abstract place for HTTP middleware, and is essentially blind to anything deeper than the existence of a Request/Response pair. This is a tried and true pattern for stacking layers of systems to build a coherent whole, but it does not help to make that whole system to be correct or understandable.

Webmachine contains an explicit model not just for handling requests, but for managing the internal semantics of the HTTP protocol itself. By providing the application developer with a straightforward and expressive way to describe their application's HTTP behavior, Webmachine makes it very easy to create systems that are shaped like the Web and are very easy to understand.

The two systems are potentially complementary. Right now Webmachine only uses mochiweb-provided requests and responses, but if a solid patch was provided that allowed Webmachine to act as an EWGI application was produced I suspect that it would be accepted. Given the shape of the two systems this should not be too large an undertaking.


EWGI is supposed to be a common API for writing request handlers, an API that many web servers implement. EWGI is inspired by Python's WSGI.

Webmachine is just a standalone application with its own API that it is alone in implementing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜