comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: Objects properties -  Ada design issues question
Date: 2000/02/04
Date: 2000-02-04T00:00:00+00:00	[thread overview]
Message-ID: <s9mdep9idh30@corp.supernews.com> (raw)
In-Reply-To: 877lgklryd.fsf@deneb.cygnus.argh.org


Florian Weimer wrote in message <877lgklryd.fsf@deneb.cygnus.argh.org>...
>Why are Get/Set subprograms inferior to this approach?  IMHO, this is
>just syntactic sugar of very questionable quality.  It doesn't make
>sense to me to write:
>
>        Some_Label.Width  := New_Width;
>        Some_Label.Height := New_Height;
>
>instead of:
>
>        Resize (Some_Label, Width => New_Width, Height => New_Height);
>
>The latter one is much more explicit and immediately suggests that
>some kind of operation takes place.


Problem arises ( as I described in previous message)  when we want
to define common interface to the set of objects ("Black Boxes") derived
from some root class and we do not know in advance properties  for
particular derived  object  that should be revealed to the client. In
addition
that properties could be very  different for different derived  classes.

Problem with standard Get  and Set approach is that you need to extend
interface for each derived type and this breaks our intention to have
common interface with some limited set of operations  to each "Black Box"
component.

So it would be nice to have common interface to different properties
(that are not known in advance) of different  kind of objects.
So here use of  ":=" as a standard Get Set operator for any property
is very useful. We just define in the private part of the implementation
what this operator does for each particular property without disturbing
public interface.

And as I shown this could be done without any change in the
current Ada syntax.

>Finally, use of properties seems to be rather restricted to visual GUI
>design, and there are some technical reasons for it in this region.


Not at all.  This problem  is not limited to this particular area.
It is much broader.

This problem arises when we try to implement "Black Box" design
model where each "Black Box" may have completely different set of
properties but provide some common sort of functionality.

 In my particular case I encountered this problem working on the
ACMN  (Ada Communication Subsystem )  for WinNT  that would
 provide common (standardized)  interface to most of the
communication resources available in the underlying OS or
driver of some communication device.

Regards,
Vladimir Olensky







  parent reply	other threads:[~2000-02-04  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-04  0:00 Objects properties - Ada design issues question Vladimir Olensky
2000-02-04  0:00 ` Florian Weimer
2000-02-04  0:00   ` Samuel T. Harris
2000-02-04  0:00   ` Vladimir Olensky [this message]
2000-02-06  0:00     ` Andy
2000-02-07  0:00       ` Vladimir Olensky
2000-02-10  0:00         ` Andy
2000-02-08  0:00     ` Florian Weimer
2000-02-04  0:00   ` Vladimir Olensky
2000-02-04  0:00 ` Vladimir Olensky
2000-02-04  0:00 ` Matthew Heaney
replies disabled

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