> 
> > My modest proposal is that these activities be encapsulated in
actual
> > "strategy" objects that perform each function.  Then, once a message
has
> > arrived and been parsed out of its raw format, it is simply passed
to
> > the list of strategies.  Other strategies can be included as needed,
so
> 
> How is this functionally different from replacing your Freenet.message
> classes with other implementations?
> 

I believe his point was (please correct me if I'm wrong) that
subclassing was not a very good mechanism for the kind of delegation
he's talking about.  I agree, with the caveat that I haven't looked at
the Request class in depth with this idea in mind.

The advantages people usually attribute to subclassing (e.g., reuse,
modularization) are actually advantages of delegation, of which
subclassing is one limited variety.  The Event Listener model in Swing
is another kind of delegation.  If you had to subclass a component in
Swing every time you wanted to respond to an event, it would be a whole
lot harder to use.  Subclassing is not always the best way to delegate.

I also think his idea is pretty good.  In general, I think it would
improve the appeal of running a Freenet node if multiple intelligent
strategies were available to select from for managing the data store,
bandwidth, access, etc.  E.g., a bandwidth cap is nice, but if the
bandwidth cap could change over time it would be even nicer, so I could
for example run a Freenet server in the office that never used more than
0.1 Mb/sec during work hours, but went up to 1 Mb/sec after work hours
and on weekends.


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

Reply via email to