> No, imagine a small Freenet based on RPC.  A gateway between Freenet
> Proper and this network would want to be able to construct calls to
> generic methods in the RPC network, like:
> 
> dataReply(Dictionary options, int htl, String url)
> 
> It wouldn't want to know the whole protocol.  It would just want to
> construct a dictionary, apply the types as necessary with the field names
> as keys, and call the method .

That's why I suggested all those methods that take things like
integer arguments for HTL, etc., ought to be recoded to take nothing
but the message object, and get those values from the message's
FieldSet itself.  That delays decoding to the very last moment, and
perhaps requires some extra encodes and decodes, but dozens of methods
suddenly lose lots of arguments, classes start looking alike so more
code sharing becomes available, the code is simpler to read, etc.

Even if we weakly type the fields, these methods should still be
fixed not to pass fields values explicity as arguments, but to look
them up from the message's FieldSet (which now has to have typed
getters and setters that would also be eliminated by just making
everything a string).

--
Lee Daniel Crocker <lee at piclab.com> <http://www.piclab.com/lee/>
"All inventions or works of authorship original to me, herein and past,
are placed irrevocably in the public domain, and may be used or modified
for any purpose, without permission, attribution, or notification."--LDC


_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to