comp.lang.ada
 help / color / mirror / Atom feed
From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Subject/Object Confusion Syndrome [was: Ada Objects Help]
Date: 1 Feb 1995 14:33:47 GMT
Date: 1995-02-01T14:33:47+00:00	[thread overview]
Message-ID: <3go64b$m4u@watnews1.watson.ibm.com> (raw)
In-Reply-To: D38q48.3yM@swlvx2.msd.ray.com

In article <D38q48.3yM@swlvx2.msd.ray.com>, jgv@swl.msd.ray.com (John Volan)
writes: 

|> Every computer program has responsibilities to perform certain actions
|> and computations with respect to the "objects" in its problem domain.
|> A good object-oriented design will take all the responsibilities that
|> pertain to a given class of real-world objects and encapsulate them
|> into a single, cohesive software module.  But in order to render that
|> into a programming language that uses this "subject-oriented" syntax,
|> you have to imagine that the objects *themselves* are responsible for
|> the actions that the computer has to "do" to them.  Now, we all know
|> that it's really the *computer* that's going to "do" these things --
|> in other words, the computer is really the "subject" of our program's
|> imperative commands.  However, because of the syntax involved, you
|> have to pretend that it's actually the "objects" that are the
|> "subjects" of these commands.
...
|>
|> In my experience, this confusion between "subject" and "object" is the
|> single most difficult conceptual hurdle you have to overcome in order
|> to master the object-oriented paradigm, whenever you work in languages
|> like C++ or Smalltalk.  Because of this confusion, it can be difficult
|> at times to decide where a certain responsibility should go.  For instance,
|> in deciding which object should have the responsibility to "mow", you
|> have to keep remind yourself that the "lawn" object is not really the
|> "lawn" itself.  It's just the "part-of-the-computer-responsible-for-doing-
|> things-to-the-lawn" -- including, perhaps, mowing it.

Thanks for an insightful analysis, which goes right to the heart of the
dispute between advocates of the

   object.operation(...)

and

   operation(object,...)

notations.

While these observations argue against the object.operation(...) notation
in C++, they do not apply to a language like Actors, where objects are
truly active.  Ada tasks are also active objects, and John's discussion
explains the indecision I've often had naming entries of Ada tasks.
Where John thinks in terms of the "computer" having responsibility to
perform certain actions, I think in terms of tasks having those
responsibilities (including the environment task that executes the main
subprogram of a single-task program); I think of procedure calls as
imperatives addressed to a task.  But when a rendezvous is to take place
so that a sender task can notify a recipient task that some event has
taken place, it is not clear whether the entry call should read as an
imperative addressed to the calling task--

 Recipient.Notify_Of_Event; -- Yo, Sender! Notify Recipient of the event!

--or the called task--

 Recipient.Note_Event; -- Yo, Recipient! Note that an event has occurred!

In John's terms, should the task name in an entry call be the subject or
the object?

(By the way, I also think the object.operation(...) notation is
justifiable for a language like Self, where different standalone objects
of the same class can have different methods.  Such methods really are
members, hardly distinguishable from data members.  My objection to the
use of this notation in C++ is that it gives the impression that
different objects in the class each have their own member functions when
in fact they all have the same function.  C++ is pretending to support a
paradigm that it does not support in earnest, the way Self does.)

--
Norman H. Cohen    ncohen@watson.ibm.com



  reply	other threads:[~1995-02-01 14:33 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3f9g1u$j4m@nps.navy.mil>
     [not found] ` <D2H5un.FEr@nntpa.cb.att.com>
     [not found]   ` <3fcs59$70s@nps.navy.mil>
     [not found]     ` <3ff186$c19@gnat.cs.nyu.edu>
1995-01-17 17:57       ` ADA Objects Help! Mats Weber
1995-01-18 17:47         ` Robert Dewar
1995-01-20 16:04           ` Mats Weber
1995-01-21 18:59             ` Robert Dewar
1995-01-23 12:03               ` Robb Nebbe
1995-01-25 20:44                 ` Mats Weber
1995-01-25 20:44               ` Mats Weber
1995-01-27  4:03                 ` Robert Dewar
1995-01-26  3:36           ` swdecato
     [not found]         ` <3fhggr$11dp@watnews1.watson.ibm.com>
     [not found]           ` <Mats.Weber-1901951739360001@mlma11.matrix.ch>
1995-01-20 17:22             ` Norman H. Cohen
1995-01-23 16:37               ` Mats Weber
1995-01-25 20:44               ` Mats Weber
1995-01-27  4:05                 ` Robert Dewar
1995-01-19 11:57   ` Robert M. Wilkinson
1995-01-22 18:06     ` Robert Dewar
1995-01-24 22:18       ` Norman H. Cohen
1995-01-25  1:26         ` swdecato
1995-01-25 18:18           ` Bob Kitzberger
1995-01-25 20:11             ` Bob Kitzberger
1995-01-26 15:31           ` Norman H. Cohen
     [not found]           ` <D330pK.M1@nntpa.cb.att.com>
1995-01-28 21:46             ` John DiCamillo
1995-01-30 14:13               ` David Emery
1995-01-30 22:50               ` Subject/Object Confusion Syndrome [was: Ada Objects Help] John Volan
1995-02-01 14:33                 ` Norman H. Cohen [this message]
     [not found]                   ` <D3DpJu.4nK@swlvx2.msd.ray.com>
     [not found]                     ` <D3H7J3.B2x@inmet.camb.inmet.com>
1995-02-06 10:32                       ` Robb Nebbe
     [not found]                     ` <3gu21g$ch@portal.gmu.edu>
1995-02-06 14:01                       ` John Volan
1995-02-01 22:37                 ` Maarten Landzaat
     [not found]                   ` <3h1ahp$gf5@gnat.cs.nyu.edu>
     [not found]                     ` <3h3jmp$1h1@Starbase.NeoSoft.COM>
1995-02-07 14:39                       ` John Volan
1995-02-09  2:25                         ` David Weller
1995-01-29 18:19             ` ADA Objects Help! mat
     [not found]               ` <1995Feb5.180601@hobbit>
1995-02-07 23:04                 ` Subject/Object Confusion Syndrome [was: Ada Objects Help] John Volan
1995-01-25  9:48       ` ADA Objects Help! mat
1995-01-23 10:01     ` calling syntax (was Re: Ada Objects) Robb Nebbe
1995-01-23 18:08       ` John DiCamillo
1995-01-23 23:47     ` ADA Objects Help! Ed Osinski
1995-01-25  6:19       ` David O'Brien
     [not found] ` <1995Jan16.132400@lglsun.epfl.ch>
     [not found]   ` <131279@cup.portal.com>
1995-01-20 16:52     ` Ada " Robert Dewar
1995-01-22 18:30       ` Tucker Taft
1995-01-24 22:09         ` Jacob Sparre Andersen
1995-01-26 16:20           ` Robert A Duff
1995-01-27 17:04             ` Robert A Duff
1995-01-27 19:58             ` Tucker Taft
1995-01-20 17:41   ` Mark S. Hathaway
1995-01-23 10:41     ` Robb Nebbe
1995-01-23 11:53     ` Stephane Barbey
     [not found] <3gtai2$3mq@horus.mch.sni.de>
     [not found] ` <3gudf1$ia1@network.ucsd.edu>
     [not found]   ` <132301@cup.portal.com>
1995-02-06 15:37     ` Subject/Object Confusion Syndrome [was: Ada Objects Help] Fergus Henderson
1995-02-07 14:43       ` John Volan
1995-02-09 20:58     ` Mike Bates
     [not found]     ` <9503802.3538@mulga.cs.mu.oz.au>
1995-02-10 15:19       ` Jules
replies disabled

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