[swift-server-dev] HTTP API Review

Alex Blewitt alblue at apple.com
Mon Sep 4 07:34:31 CDT 2017


> On 4 Sep 2017, at 13:13, Michael Nisi <michael.nisi at gmail.com> wrote:
> 
> Why? 

Because in this instance, the protocol isn't meant to be used by the customer, it's intended to be implemented by the end customer. And the swift naming guidelines suggest that using an adjective for a protocol is for its capability.

The thing is, this protocol isn't doing anything. It's merely an API surface for others to implement, such that it can be plugged into an HTTP server implementation that knows how to talk to the API.

Separately, having '-ing' describe the protocol and '-er' be an implementation of that protocol sounds like a recipe for confusion later on.

Alex

> 
> I prefer adjective protocol naming, because of its semantic meaning and it leaves the noun, HTTPRequestHandler in this case, free to be used by the implementation.
> 
> Michael
> 
>> On 4. Sep 2017, at 10:28, Alex Blewitt via swift-server-dev <swift-server-dev at swift.org> wrote:
>> 
>> I'm not convinced that using HTTPRequestHandling is a good protocol name. Why not use HTTPRequestHandler instead?
>> 
>> Alex



More information about the swift-server-dev mailing list