[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: client API not optimal

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-08-26 23:21:11 CEST

On Mon, Aug 26, 2002 at 05:02:29PM -0400, Greg Hudson wrote:
> Brent Matzelle wrote:
> > Unfortunately I do not have a method to abstract the notify
> > functions. Hopefully this can be worked out later.
>
> I guess the C++ way of doing this is subclassing and virtual methods.
> For instance, the class which interfaces to svn_client_update() could
> call its own update_notify() method in response to a notify_func call.
> The base implementation would do nothing; an application could subclass
> that type and override the method.
>
> Or some variation on that idea.

I would see it as the client provides a "Notified" object which has a pure
virtual interface on it. The C++ wrappers would invoke the appropriate
methods on the supplied Notified object. Thus, you could easily mix/match
notification callbacks without changing/subclassing the target object.

(this is the model that I intend to use with the Python bindings)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 26 23:16:42 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.