On Wed, Apr 04, 2001 at 01:27:58PM -0400, Gianni Johansson wrote:
> On Wednesday 04 April 2001 02:02,  Tavin wrote:
> > >
> > > Can you really do this without sacrificing the rich functionality
> > > provided by the current Client implementation?
> >
> > Yes.
> What I meant by this is that no matter what Client factory I use, I must get
> exactly the same behavior from the resulting Client interface, including the
> order and type and arguments of all events dispatched during the execution of 
> all public methods.  

Well, the Client instance returned by ClientFactory.obtainClient() is not
identical to the current Client class.  It's only method is execute().
However the event model has not been changed at all.  So once you call
that execute() the remaining behavior is identical.  You synchronize on
your listener and wait for the same events as always.

> If you cannot satisfy this requirement then the "Client" you are returning 
> from your client factory isn't equivalent to the current Client  at all.  It 
> is something else and should have a different type (e.g. 
> LowestCommonDenominatorClient)
> 
> I don't see how you can do this at least not without a significant amount of 
> work.  

I already did it.  It wasn't hard.  This is just a reorganization of existing
structures, not a wholesale rewrite.

> Doesn't FCPClient have less functionality than the FNPClient?

It has (will have) the same or more.

> > > What about ClientEvents?
> >
> > I didn't change the event framework at all.  You just add your listeners to
> > the Request object instead of the RequestToken.
> >
> It isn't a question of changing the framework.  It is a question of 
> supporting the identical event behavior across varying backend 
> implementations.

The real yardstick is supporting identical event behavior across varying
backends, *considered separately for each Request type*.  Some Request
types may not generate certain events and some may generate as yet
uncoded events.  However none of that will impact our old friends
DataRequest and InsertRequest.  The event behavior will be identical
for them across all backends, and it will be the same as it is now.

Honestly, the 5-line code change I pasted in my original email is all you
need to worry about for now.  The rest of the enhancements won't break
compatibility so you can use them or not as you like.

-- 

# tavin cole
# if code is law, then Freenet is a crowded theater


_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to