[ProgSoc] Thought for the day

John Elliot jj5 at jj5.net
Sat Nov 7 16:23:56 EST 2009


Michael F wrote:
> You could argue that every protocol for communication is stateful because it
> relies on the state of the receiver (whether or not they are still there)
> for proper communication to take place.

My argument is similar to, but not quite exactly, that.

> I think this confuses the application of the protocol with the abstract
> concept of the protocol itself, however.

You can keep within the bounds of "the abstract concept of the protocol 
itself" by assuming that it applies to at least two existing parties and 
still argue that the communication is stateful (or stateless).

>> The term 'stateless' as applied to HTTP is neither correct nor useful.
>
> I would argue that any protocol which hides the state of the application
> isn't useful as there would be no need for communication to take place if
> the state of the applicaiton didn't change and/or could be determined before
> hand.

There are instances I can think of where the application layer is 
properly 'stateless'. For instance say we had a web-based charting 
application that took an array of numbers as input and turned those into 
a PNG of a bar-chart representation of those numbers. The result of a 
single HTTP GET request to such an application would be fully determined 
by the content of the request (the input array of numbers would go in 
the query string of a URL), and as no state external to the request is 
required in generating output both the request itself and the protocol 
it uses could be said to be 'stateless'. However, when I take a request 
and dereference a component of its content to get at some other state 
then it's no longer possible to claim statelessness.

> This would mean that HTTP is only useful because it possesses your
> statefulness property.

No, HTTP could still be stateless and useful (in some circumstances), 
it's just that many HTTP requests aren't stateless in that they are made 
based on the results of previous requests (i.e. what's known about the 
previous state of the server).

> The term 'stateless' when applied to a communication protocol is generally
> taken to mean that in order to communicate using the protocol those
> communicating do not need to be aware of any previous communications between
> each other.

Right, and in this case the server needed to be aware of the change of 
state to the file permissions that occurred between two identical requests.

> You could take an alternate definition in which the
> stateful/less property of a protocol is dependent on the actual data sent
> and received over it, but such a definition would, as you said, lead the
> terms stateful and stateless to be useless.

It wouldn't make the terms useless at all. It would make them correct!









More information about the Progsoc mailing list