[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: src/dictionary.c
From: |
Ben Pfaff |
Subject: |
Re: src/dictionary.c |
Date: |
Sun, 08 Mar 2009 21:08:48 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
John Darrington <address@hidden> writes:
> For a while, I've been unhappy about the way the GUI makes use of
> dictionary.c
>
> Currently, we have an object called PsppireDict which contains a
> pointer to a (struct dictionary) which is created externally. In
> order that PsppireDict is aware of changes made to to (struct
> dictionary), the latter has a set of callbacks to which the containing
> PsppireDict connects. Further, the (struct dictionary) can be
> destroyed, whilst the PsppireDict survives. Typically, this happens
> on each procedure - the old dictionary is destroyed and a new one
> created in its stead. The gui has to anticipate this, and reload the
> new dict, and it emits a "backend-changed" signal. All of this is
> really messy, and is beginning to make the GUI unmaintainable.
The one thing that would worry me about making dictionary a
"virtual class" is that it would, I think, be a very broad class.
That is, it would have quite a large number of member functions.
The cleanest and most beneficial virtual classes, in my
experience, are those that encapsulate complex behavior behind a
very simple interface. I think that the casereaders are a good
example, actually.
If you want to take a stab at re-implementation in this form,
though, then I'd be happy to take a look at the result. I've
been surprised before when you have shown that changes that I
thought would be difficult or awful were really not so bad.
--
Ben Pfaff
http://benpfaff.org
- src/dictionary.c, John Darrington, 2009/03/08
- Re: src/dictionary.c,
Ben Pfaff <=