Re: [sigc] conditions in libsigc
- From: "Timothy M. Shead" <tshead k-3d com>
- To: libsigc-list gnome org
- Subject: Re: [sigc] conditions in libsigc
- Date: Sun, 09 Jul 2006 10:11:42 -0600
On Sat, 2006-07-08 at 17:40 +0300, Paul Pogonyshev wrote:
> I posted an implementation here and repost it. Note that conditions and
> sensivity statement in the example is not so nice, because there is no
> (yet) support on the part of Gtkmm. It looks like this:
>
> controller = new SensivityController (button,
> (condition (new EntryNotEmptyCondition (entry))
> & condition (new ToggleButtonActiveCondition (check_button))));
Any non-trivial application is going to require application-specific
business logic for many of these types of decisions, so the application
author *will* have to create a lot of one-off condition classes in order
to use the framework, the conditions that are provided as part of the
library will not be sufficient. To me, this negates the value of
automatic initialization.
Further, I don't agree that the intent of the condition-alized code is
any clearer or less error-prone than the equivalent code without
conditions. You are basically creating your own custom functional
language, to do something that can already be expressed more compactly
in C++. How will you handle unions? Negation? Precedence? Grouping?
> I want to note that it doesn't require much from sigc++. It is a small
> new module, probably some 1000 lines in one file. And it doesn't
> influence the existing functionality in any way.
The only relationship between conditions and sigc++ is that it's part of
their implementation. I strongly recommend against adding conditions to
sigc++.
Regards,
Tim Shead
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]