Re: [sabayon] how to associate a delegate and a source
- From: Mark McLoughlin <markmc redhat com>
- To: John Dennis <jdennis redhat com>
- Cc: sabayon-list <sabayon-list gnome org>
- Subject: Re: [sabayon] how to associate a delegate and a source
- Date: Tue, 08 Mar 2005 10:45:27 +0000
On Mon, 2005-03-07 at 17:53 -0500, John Dennis wrote:
> get_source is called in several places to construct a source instance
> and is passed a storage.
>
> get_files_delegate is called with a source instance (in this case a
> FilesSource).
>
> Now suppose the delegate wants to do something on behalf of the source
> in the source module, e.g. mozillasource.py creates both a MozillaSource
> (returned by get_souarce) and a file delegate watching for changes in
> the mozilla directory. When the delegate sees a change it wants to react
> to it wants to do this in the context of (e.g. "self") of the right
> MozillaSource instance.
>
> I don't see anything that relates a delegate to a source instance (not
> the delegates source!, the source the module returns in get_source).
I don't see that it makes any sense for there to be both a mozilla
source and deletegate. A delegate and source is essentially the same
thing except that a source is itself aware of external changes, whereas
a delegate intercepts changes from a source.
So, either the mozilla code monitors the config files itself (in which
case its a source) or it just intercepts the changes from the files
source (i.e. its a delegate). I think the latter makes most sense.
Cheers,
Mark.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]