Why Reply does not inherit from MIMIHeaders?

Alexandre Rafalovitch writes:
 > Hi,
 > Looking through the api's for Request and Reply I noticed that Request
 > inherits from MIMIHeaders. Reply is supposed to have the same format as a
 > request, it just has different set of headers. They both are set of
 > request/reply headers, set of  entity headers and sometimes entity body,
 > aren't they?

Yes they are. There was a reason behind this: the request uses a
hashtable to keep track of the headers, which means that accessing
header values can be not that efficient. As the reply class was first
defined, I thought people would heavily query a reply to get the most
common field values, and hence decided to drop the relationship to the
MIMEHeader object.

 > So why then Reply is not inherited from MIMEHeaders as well? As far as I
 > could see, there is nothing in MIMEHeaders class that conflict with Reply.
 > (Well maybe language is: MIMEHeaders use Language class, where Reply use
 > String ???).

Now, I am currently rewriting all the mime/http parsers, with the hope
to make them much more efficient by:

a) using a 'clever' scheme to get fast access to specified fields
b) parsing byte arrays, instead of Strings

This rewrite was trigered by the fact that we want Jigsaw to be 1.1
compatible. In this new design, botth Request and Reply will be
sub-classes of the HttpMessage class. I hope to be able to keep the
current Request/Reply APIs stable through this process...

Anselm.

Received on Friday, 21 June 1996 18:37:45 UTC