On Thu, 27 Apr 2000, Brandon wrote:
> > Sundaes: Chocolate with Chocolate, Chocolate with Strawberry
> > ... etc"
> 
> > or I could write: Sundaes: Chocolate, Strawberry
>   served with a choice of Chocolate or Strawberry topping.
> 
> The only reason I disagree here is because I don't in what case a message
> would be subclasses except to deal with a different key type. The
> difficulty of not having multiple inheritance only comes about if there is
> a reason to multiply inherit.

The thing is, it doesn't take any imagination to think of Request subclasses
being used for something other then keytypes, because we already have two
subclasses of Request used right now: InsertRequest and DataRequest. 

> > 1) Having one way to add different new capabilities is not necessarily a 
> > good
> > thing, because of the effect above. It also creates a major problem with
> > inheritance.
> 
> Maybe. And if you can provide a convincing example, then I
> agree. Otherwise, I think one way to add capabilities is nice and
> convenient and elegant.

Again, we already have an example with InsertRequest and DataRequest. You want
all the keytype related methods in the Message class, so then you either need
to:

Implement subclasses for every type of key of both InsertRequest and
DataRequest. So you get InsertRequest.CHK and DataRequest.CHK duplicating the
CHK related code, InsertRequest.SVK and InsertRequest.SVK duplicating the SVK
related code etc.

Or you implement the keytype subclasses first, so you get

Request.CHK
Request.KHK
Request.SVK

but then we need to put the Insert specific code in both Request.CHK.Insert,
Request.KHK.Insert and Request.SVK.Insert. 

Another thing I don't understand about what you have been saying, is the thing
about multiple tables. If you need a new table in the datastore for every new
keytype, then how can they be pluggable without changing the DataStore code?
And what does it give over just indexing them by type and value in a single
table?

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

Oskar Sandberg

md98-osa at nada.kth.se

#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

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

Reply via email to