comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Properties
Date: Fri, 3 Dec 2010 15:32:20 -0600
Date: 2010-12-03T15:32:20-06:00	[thread overview]
Message-ID: <idbnl6$3qd$1@munin.nbi.dk> (raw)
In-Reply-To: 0c899bff-c580-4b9f-9c94-b9226c089cde@j29g2000yqm.googlegroups.com

"Maciej Sobczak" <see.my.homepage@gmail.com> wrote in message 
news:0c899bff-c580-4b9f-9c94-b9226c089cde@j29g2000yqm.googlegroups.com...
On Dec 3, 5:43 am, "Randy Brukardt" <ra...@rrsoftware.com> wrote:

>> When it comes to GUI programming, this supposedly "good design principle"
>> often doesn't make any sense.
>>
>> For example, consider the series of SLED (Simple Little EDitor) examples 
>> in
>> Claw. These show how a Notepad-like editor could be constructed using 
>> Claw.
>
>Yes. There are two points, however:
>
>1. Text editors (in particular text widgets) are both sources and
>destinations of data. That is, they not only display something, they
>also control the content by allowing the user to interact with it and
>modify it. Thanks to this coupling of functionality (content control
>and rendering) it makes sense to delegate the data structure
>management to the same component as well. In this regard text widgets
>are self-contained.

Right. My point is that is the quite natural to have widgets like that. Text 
processing surely is not the only example.

>Unfortunately this reasoning has no applicability in a real-time
>oscilloscope display, where such coupling does not occur - data source
>is definitely separate from the rendering component so there is no
>justification for coupling data model with widgets. On the contrary,
>it makes perfect sense to decouple them - for starters, did I mention
>several displays showing the same signal, but with different filtering
>settings?

Possibly, but irrelevant. My point was that the "good design principle" is 
nowhere near absolute when it comes to GUIs. It makes just as much sense for 
some applications to have a control (widget) that does everything. I never 
claimed that you should *never* separate these things, only that claiming 
that a design that does not do so is somehow wrong is simplistic.

>2. Your text-editing example has little relation to multitasking as a
>general GUI feature. Of course one can imagine, for example, a
>background spellchecker task or something in this area, but this is so
>particular to the text editing domain that is hardly a justification
>for requiring that the whole GUI framework must be task-safe.

I don't believe that a general-purpose library should be telling people how 
to design their software. (This is very similar to the issue of almost never 
using access types in the interface -- the library should not be telling 
people how to do memory management.)

Indeed, I think that *any* library intended for general Ada usage ought to 
be task-safe to the extent that Ada.Text_IO and Ada.Containers are (access 
to different objects of the library by different tasks always work). That 
surely includes GUI libraries. That's all that Claw guarantees (that two 
tasks can access different controls/windows without interference). Libraries 
that don't meet those basic Ada requirements are very constraining, lead to 
the sort of problems that Dmitry mentioned (accidental use from the wrong 
task causes crashes and no clear indication of the mistake). Sometimes you 
have to use such things, but they then require wrapping in the Ada 
environment (unless you like debugging!).

                                    Randy.





  reply	other threads:[~2010-12-03 21:32 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28  3:21 Properties Shark8
2010-11-28  8:15 ` Properties Dmitry A. Kazakov
2010-11-28 19:43   ` Properties Shark8
2010-11-29  8:34     ` Properties Dmitry A. Kazakov
2010-12-01 18:15       ` Properties Shark8
2010-11-28 12:37 ` Properties Georg Bauhaus
2010-11-28 21:22   ` Properties Shark8
2010-11-29 16:54     ` Properties Georg Bauhaus
2010-12-01 19:52   ` Properties Martin Krischik
2010-12-01 23:24     ` Properties Georg Bauhaus
2010-12-05 16:15       ` (placepo) Properties Martin Krischik
2010-12-06 23:24         ` Shark8
2010-12-01 23:31     ` Properties Georg Bauhaus
2010-11-30  1:49 ` Properties Randy Brukardt
2010-11-30 16:58   ` Properties Charmed Snark
2010-11-30 17:22     ` Properties Dmitry A. Kazakov
2010-11-30 20:27       ` Properties Warren
2010-12-01  8:39         ` Properties Dmitry A. Kazakov
2010-12-01 15:21           ` Properties Warren
2010-12-01 15:59             ` Properties Dmitry A. Kazakov
2010-12-01 16:20               ` Properties Warren
2010-12-01 18:22                 ` Properties Dmitry A. Kazakov
2010-12-01 19:36                   ` Properties Shark8
2010-12-01 21:13                     ` Properties Dmitry A. Kazakov
2010-12-01 21:35                   ` Properties Maciej Sobczak
2010-12-01 21:45                     ` Properties Dmitry A. Kazakov
2010-12-02  9:57                       ` Properties Maciej Sobczak
2010-12-02 10:26                         ` Properties Dmitry A. Kazakov
2010-12-02 15:25                           ` Properties Maciej Sobczak
2010-12-02 15:46                             ` Properties Dmitry A. Kazakov
2010-12-02 21:11                               ` Properties Maciej Sobczak
2010-12-02 22:19                                 ` Properties Dmitry A. Kazakov
2010-12-03  4:43                                 ` Properties Randy Brukardt
2010-12-03 13:53                                   ` Properties Maciej Sobczak
2010-12-03 21:32                                     ` Randy Brukardt [this message]
2010-12-04 22:13                                       ` Properties Maciej Sobczak
2010-12-06 23:30                                         ` Properties Shark8
2010-12-06 23:33                                         ` Properties Randy Brukardt
2010-12-04 17:43                           ` Properties Simon Wright
2010-12-04 20:48                             ` Properties Dmitry A. Kazakov
2010-12-04 22:27                               ` Properties Simon Wright
2010-12-04 22:31                                 ` Properties Vinzent Hoefler
2010-12-03  4:24                         ` Properties Randy Brukardt
2010-12-03  5:00                         ` Properties Shark8
2010-12-03 21:10                           ` Properties Randy Brukardt
2010-12-03 23:34                           ` Properties Jeffrey Carter
2010-12-06  6:02                             ` Properties Brad Moore
2010-12-06 23:25                               ` Properties Shark8
2010-12-01 19:48                 ` Properties Randy Brukardt
2010-12-01 21:10                   ` Properties Warren
2010-12-02  0:03                     ` Properties Shark8
2010-12-02 16:45                       ` Properties Warren
2010-12-02 17:32                         ` Properties Dmitry A. Kazakov
2010-12-02 20:45                           ` Properties Warren
2010-12-02 21:17                             ` Properties Adam Beneschan
2010-12-02 21:40                               ` Properties Warren
2010-12-03  3:34                             ` Properties Shark8
2010-12-03  8:16                               ` Properties Thomas Løcke
2010-12-02 20:52                           ` Properties Pascal Obry
2010-12-02 19:46                         ` Properties Adam Beneschan
2010-12-02 20:38                           ` Properties Warren
2010-12-02 21:39                             ` Properties Jeffrey Carter
2010-12-02 21:55                               ` Properties Warren
2010-12-03  9:33                               ` Properties Anonymous
2010-12-03  3:47                           ` Properties Shark8
2010-12-03  0:09                         ` Properties Robert A Duff
2010-12-03 15:49                           ` Properties Warren
2010-12-03 20:07                             ` Properties Shark8
2010-12-06 21:01                               ` Properties Warren
2010-12-06 23:22                                 ` Properties Shark8
2010-12-07 14:37                                   ` Properties Warren
2010-12-08 21:13                                   ` Properties Simon Wright
2010-12-09  1:21                                     ` Properties Shark8
2010-12-06 23:43                                 ` Properties Randy Brukardt
2010-12-07  0:56                                   ` Properties Jeffrey Carter
2010-12-07 11:23                                   ` Properties Maciej Sobczak
2010-12-07 11:51                                     ` Properties Georg Bauhaus
2010-12-07 15:35                                       ` Properties Maciej Sobczak
2010-12-07 17:02                                         ` Properties Georg Bauhaus
2010-12-07 14:39                                   ` Properties Warren
2010-12-03 15:40                         ` Properties Warren
2010-12-03 19:56                           ` Properties Shark8
2010-12-03 20:12                             ` Properties Warren
2010-12-03  5:53               ` Properties Shark8
2010-12-03  9:05                 ` Properties Dmitry A. Kazakov
2010-12-03 19:52                   ` Properties Shark8
2010-12-03 21:14                     ` Properties Randy Brukardt
2010-12-04  5:35                       ` Properties Shark8
2010-12-04 14:23                         ` Properties Peter C. Chapin
2010-12-04 18:53                           ` Properties Shark8
2010-12-13 15:10                       ` Properties Brian Drummond
2010-12-03 22:38                     ` Properties Dmitry A. Kazakov
2010-12-04  3:12                       ` Properties Shark8
2010-12-04 13:19                     ` Properties Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2010-12-04 19:53 Properties Shark8
2010-12-04 23:27 ` Properties Thomas Løcke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox