[swift-server-dev] Draft proposal for TLS Service APIs (please review)

Gelareh Taban gtaban at us.ibm.com
Mon Apr 3 09:33:35 CDT 2017


There are 2 hard problems in computer science: cache invalidation, **naming
things**, and off-by-1 errors. -- Leon Bambrick

:-)


> > * These are essentially delegate methods notifying the TLS engine of an
event.
> > `onAccept` says that the system has accepted a connection and the TLS
engine should
> > do what it needs to do with it, `onSend` means the system is about to
send data and
> > it needs the TLS engine to modify it, etc. If so, Swift APIs more often
use words like
> > `should`, `will`, or `did` than `on`, particularly since they're more
precise about the
> > timing of the delegate method compared to the actual event.
>
> +1 onXXX methods look definitely non-Swifty to me.


Fair enough. What do you recommend?


>
> One other thing that bothers me is the `Service` postfix  of the main
protocol.
> `Service` is a common name used in higher-level applications.
>
> Maybe we could replace it with another postfix (e.g. `Engine`) or even
drop it completely?


I agree that Service is not a particularly good name but that was the best
I could think of. I liked Engine but (1) we are not implementing anything,
just overlaying and (2) I didnt want any confusion with with the SSL Engine
of OpenSSL.

So again, I would be interested in your recommendations!


gelareh






From:	Georgios Moschovitis <george.moschovitis at icloud.com>
To:	Brent Royal-Gordon <brent at architechies.com>
Cc:	Gelareh Taban/Austin/IBM at IBMUS, swift-server-dev at swift.org,
            Bill Abt/Cambridge/IBM at IBMUS
Date:	04/01/2017 01:23 AM
Subject:	Re: [swift-server-dev] Draft proposal for TLS Service APIs
            (please review)



> * These are essentially delegate methods notifying the TLS engine of an
event. `onAccept` says that the system has accepted a connection and the
TLS engine should do what it needs to do with it, `onSend` means the system
is about to send data and it needs the TLS engine to modify it, etc. If so,
Swift APIs more often use words like `should`, `will`, or `did` than `on`,
particularly since they're more precise about the timing of the delegate
method compared to the actual event.

+1 onXXX methods look definitely non-Swifty to me.

One other thing that bothers me is the `Service` postfix  of the main
protocol.
`Service` is a common name used in higher-level applications.

Maybe we could replace it with another postfix (e.g. `Engine`) or even drop
it completely?

-g.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20170403/37f85400/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20170403/37f85400/attachment.gif>


More information about the swift-server-dev mailing list