[Seaside] Better protocol conformity
Tim Rowledge
tim@sumeru.stanford.edu
Wed, 24 Apr 2002 10:39:59 -0700
Nevin Pratt <nevin@smalltalkpro.com> is claimed by the authorities to have written:
> For example, let's say your code wants to read the host from the
> request. You can get the host from an HttpRequest via
>
> request header at: 'host'
>
> However, to do the same with an "IARequest" instance, you do this:
>
> request headerAt: 'host'
> or possibly this...
> request headers at: 'host'
I don't have any opinion on making HttpRequest & IARequest closer, but
I'll certainly proclaim that #headerAt: is better than 'header at:'
since it hides the implemetnation of how the header stuff is done. I
really, really dislike seeing chains of trivial accessor messages - it's
nothing more than a poor way of expressing foo.bar.blather C-like
nonsense.
Use request hostHeader, implemented as headerAt: #host', in turn
implemented as headers at: name. It makes it much easier to refactor
later, and you know you're going to need to refactor later; unless
of course the last customer is dead.
tim
--
Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- Always responds to "Make Money Fast" postings on the Net.