comp.lang.ada
 help / color / mirror / Atom feed
From: pcg@aber.ac.uk (Piercarlo Grandi)
Subject: Re: Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools)
Date: 1996/11/07
Date: 1996-11-07T00:00:00+00:00	[thread overview]
Message-ID: <vwjpw1pzyue.fsf@osfb.aber.ac.uk> (raw)
In-Reply-To: 328109CD.6685@concentric.net


>>> "alovejoy" == Alan Lovejoy <alovejoy@concentric.net> writes:

alovejoy> Objects are objects, not classes.

Ok, even if there are some famous authors that don't seem to agree.

alovejoy> OO programs are systems of interacting **objects**, not
alovejoy> systems of interacting **classes**.

Consider:

  class complex
  {
  private:  float rho,theta;
  public:   float proj_real(); float proj_imag();
	    complex operator +(complex);
	    ....
	    
  };

  class rational
  {
  private:  float above,below;
  public:   float num(); float den();
	    rational operator +(rational);
	    ....
  }

  ....

So far this is not an OO program, according to your definition, for
there are no objects whatsoever in it, only classes, and there are no
``interactions'' among classes in it either.

alovejoy> The architecture and design of a program is a function of what
alovejoy> **objects** it contains and how they interact.

Now let's try to add some more detail:

  // the above plus ...

  main()
  {
    complex c1, c2;

    operator >>(cin,c1); operator >>(cin,c2);
    operator <<(cout,operator +(c1,c2));

    // or more briefly: cin >> c1; cin >> c2; cout << (c1+c2);

    exit(0);
  }

Is this an OO program? It's hard for me to see any objects in it either
for I can only see variables (memory objects, a different concept) and
they don't interact with each other in any sort of interesting meaning
of the word.

To my naked eye the above is an (outline of an) OO program, but it
contains only classes ('complex' and 'rational', variables ('c1', 'c2',
'cin', 'cout') and procedures ('main', 'operator <<', 'operator >>'
'operator +', and 'exit').

Objects do come into existence (thanks to the execution of constructors)
only during the _execution_ of the program, and they are passed as
arguments to various procedures at execution time too; they don't seem
to be contained in the *program*, and even when they are contained in a
computation created by executing the program they don't seem to
interact, any more than the arguments to a procedure may be said to
``interact''.

alovejoy> What classes these objects may or may not be instances of is a
alovejoy> separate issue--a fact which becomes obvious in a Self
alovejoy> program, for example.  What matters is the **interface**
alovejoy> supported by each object,

alovejoy> and the **role** each object plays in the program.  Note that
alovejoy> two objects may support the same interface, but be instances
alovejoy> of different classes and/or play different roles.

What is a role that an object may play? It is usually easy to see
interfaces in OO programs; for example in the above program it is easy
to discern which interfaces the 'complex' and 'rational' classes have
got; but what roles do objects play in the above program?

I do realize that according to your definitions the above program is not
an OO program (there are no objects and no interaction among them); then
perhaps you could provide an example of an OO program, in which
according to your definition there are objects, they ``interact'', they
have interfaces, and they play roles. For the sake of appealing to a
wider audience, it would be important that the example be written in
something resembling C++.




  reply	other threads:[~1996-11-07  0:00 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-06  0:00 Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Dong Oh Kim
1996-11-06  0:00 ` Paul_Gover
1996-11-06  0:00   ` Snowball
1996-11-13  0:00     ` Peter Pflaum
1996-11-13  0:00       ` David N. Smith
1996-11-06  0:00   ` Alan Lovejoy
1996-11-07  0:00     ` Piercarlo Grandi [this message]
1996-11-10  0:00       ` drs
1996-11-12  0:00         ` Piercarlo Grandi
1996-11-10  0:00       ` Vlastimil Adamovsky
1996-11-11  0:00         ` Piercarlo Grandi
1996-11-11  0:00           ` Anthony Menio
1996-11-18  0:00             ` Piercarlo Grandi
1996-11-20  0:00               ` Anthony Menio
1996-11-27  0:00                 ` Piercarlo Grandi
1996-11-12  0:00           ` Anthony Menio
1996-11-18  0:00             ` Piercarlo Grandi
1996-11-19  0:00               ` Anthony Menio
1996-11-27  0:00                 ` Piercarlo Grandi
1996-11-11  0:00       ` Daniel Drasin
1996-11-12  0:00         ` Anthony Menio
1996-11-08  0:00     ` Paul_Gover
1996-11-08  0:00       ` Ell
1996-11-08  0:00         ` Alan Lovejoy
1996-11-13  0:00           ` Ell
1996-11-08  0:00       ` Alan Lovejoy
     [not found]         ` <6KZQfjK-3RB@herold.franken.de>
1996-11-10  0:00           ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Chris
1996-11-10  0:00             ` Vlastimil Adamovsky
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Bill Gooch
1996-11-12  0:00           ` Jan Steinman
1996-11-12  0:00             ` Alan Lovejoy
1996-11-13  0:00               ` Nick Thurn
1996-11-13  0:00                 ` Alan Lovejoy
1996-11-14  0:00                   ` Nick Thurn
1996-11-12  0:00           ` Alan Lovejoy
1996-11-13  0:00             ` Nick Thurn
1996-11-13  0:00             ` Ell
1996-11-14  0:00             ` Bill Gooch
1996-11-19  0:00               ` Tim Ottinger
1996-11-10  0:00       ` vlad
1996-11-12  0:00     ` Robert C. Martin
1996-11-12  0:00       ` Alan Lovejoy
1996-11-14  0:00         ` David N. Smith
1996-11-14  0:00           ` Bill Gooch
1996-11-20  0:00         ` Robert C. Martin
1996-11-20  0:00           ` Michael Malak
1996-11-20  0:00             ` Robert Dewar
1996-11-20  0:00           ` Robert Dewar
1996-11-26  0:00           ` Tucker Taft
1996-12-03  0:00             ` Robert C. Martin
1996-12-08  0:00               ` Tucker Taft
1996-11-06  0:00   ` Jan Steinman
1996-11-07  0:00     ` Paul_Gover
1996-11-12  0:00     ` Robert C. Martin
1996-11-12  0:00       ` Alan Lovejoy
1996-11-12  0:00       ` Snowball
1996-11-15  0:00         ` Soren Skogstad Nielsen
1996-11-28  0:00         ` Piercarlo Grandi
1996-11-28  0:00         ` Piercarlo Grandi
1996-11-07  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Joachim Durchholz
1996-11-08  0:00   ` Richard A. O'Keefe
1996-11-09  0:00     ` Piercarlo Grandi
1996-11-13  0:00       ` Richard A. O'Keefe
1996-11-27  0:00         ` Piercarlo Grandi
1996-11-08  0:00 ` Jon S Anthony
1996-11-08  0:00 ` Alan Lovejoy
1996-11-08  0:00 ` Joachim Durchholz
1996-11-12  0:00   ` Alaric B. Williams
1996-11-13  0:00   ` Richard A. O'Keefe
1996-11-08  0:00 ` Nick Thurn
1996-11-08  0:00   ` Alan Lovejoy
1996-11-11  0:00     ` Nick Thurn
1996-11-11  0:00       ` Paul_Gover
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) David N. Smith
1996-11-12  0:00           ` Anthony Menio
1996-11-11  0:00         ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Anthony Menio
1996-11-11  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE tools) Cesar A. Gonzalez Perez
1996-11-12  0:00 ` Interesting but sensitive topic to discuss (HELP: - OOP and CASE t Joachim Durchholz
1996-11-20  0:00   ` Piercarlo Grandi
replies disabled

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