comp.lang.ada
 help / color / mirror / Atom feed
* OO and modules ( was Which book for ADA beginner ?)
  2001-01-29  2:28           ` Andrzej Lewandowski
@ 2001-01-29 14:03             ` Hans-Olof Danielsson
  2001-01-29 15:58               ` James Rogers
  2001-02-02 22:06               ` Mark Lundquist
  0 siblings, 2 replies; 5+ messages in thread
From: Hans-Olof Danielsson @ 2001-01-29 14:03 UTC (permalink / raw)
  To: comp.lang.ada

Andrzej Lewandowski wrote:

>......
> object orientation and modules are in principle orthoogonal concepts, and
> that BOTH and SEPARATE are required to build well structured OO programs.

That�s interesting. Does that mean that adding, modifying or deleting an
OO-object from a software system doesn�t effect the architecture of it as
the architecture deals with components ( modules ) and their relationship?

> C++, Eiffel, Smalltalk ond others are using classes for both purposes: OO
and
> encapsulation (say, modularization).

> Ada95 and Oberon are two (well, maybe not
> the ONLY two...) languages that separate these two notions.
>......

and are therefore more expressive at the architectual level compared to the
first group languages?

And to which group does Java with its interface and package constructs
belong, the first or the second and why?

HOD








^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OO and modules ( was Which book for ADA beginner ?)
  2001-01-29 14:03             ` OO and modules ( was Which book for ADA beginner ?) Hans-Olof Danielsson
@ 2001-01-29 15:58               ` James Rogers
  2001-02-02 22:07                 ` Mark Lundquist
  2001-02-02 22:06               ` Mark Lundquist
  1 sibling, 1 reply; 5+ messages in thread
From: James Rogers @ 2001-01-29 15:58 UTC (permalink / raw)


Hans-Olof Danielsson wrote:
> 
> Andrzej Lewandowski wrote:
> 
> >......
> > object orientation and modules are in principle orthoogonal concepts, and
> > that BOTH and SEPARATE are required to build well structured OO programs.
> 
> That�s interesting. Does that mean that adding, modifying or deleting an
> OO-object from a software system doesn�t effect the architecture of it as
> the architecture deals with components ( modules ) and their relationship?

I do not see how you can draw your conclusion from the above statement.
Encapsulation includes the definition of classes, but also includes the
definition of what some languages call "name space". This is the ability
to differentiate between two classes with the same name in the same 
program.

> 
> > C++, Eiffel, Smalltalk ond others are using classes for both purposes: OO
> and
> > encapsulation (say, modularization).

C++ has added a new feature called name spaces to allow the 
use and identification of multiple classes with the same name in a
single program. This feature was added because the original concept
of all encapsulation occurring only in the class was found to be
too limiting, particularly when trying to use pre-defined libraries.

> 
> > Ada95 and Oberon are two (well, maybe not
> > the ONLY two...) languages that separate these two notions.
> >......
> 
> and are therefore more expressive at the architectual level compared to the
> first group languages?

Actually, yes.

The ability to define groupings of class definitions does allow
greater expressive freedom than languages lacking such ability.

> And to which group does Java with its interface and package constructs
> belong, the first or the second and why?
> 

Java tries very hard to be like Eiffel and Smalltalk. However, Java
added its own versions of name spaces in JDK 1.1. Packages were added,
as well as top level nested classes. Both features exist solely to
provide the expressiveness of name spaces. 

I would assert that the developers of Java became aware of the need
for name spaces. They added two competing mechanisms to allow
the developer to implement name spaces. In the case of packages,
they also redefined the meaning of their access modifiers to allow
visibility which, IMHO weakens their encapsulation model.

Java interfaces are not related to inheritance. They are related to
polymorphism, which should never be confused with inheritance.
Polymorphism in Java is extended by interface implementation because
every class that implements an interface can be relied upon to
implement a method with the specific signature published in the
interface definition.  Syntactically, an interface definition is
just that, a definition of method signatures, with the occasional
addition of some constants.

Do not confuse Java interfaces with abstract classes. Java also
has abstract classes. Abstract classes become the basis for an
inheritance hierarchy, just as in Ada. Interfaces are never the
basis for an inheritance hierarchy. Java syntax makes this 
distinction very clear. Inheritance is achieved using the
"extends" keyword. Interfaces are implemented using the
"implements" keyword.

Jim Rogers
Colorado Springs, Colorado USA



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OO and modules ( was Which book for ADA beginner ?)
  2001-01-29 14:03             ` OO and modules ( was Which book for ADA beginner ?) Hans-Olof Danielsson
  2001-01-29 15:58               ` James Rogers
@ 2001-02-02 22:06               ` Mark Lundquist
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Lundquist @ 2001-02-02 22:06 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]


Hans-Olof Danielsson <Hans-Olof.Danielsson@swipnet.se> wrote in message
news:mailman.980777779.24788.comp.lang.ada@ada.eu.org...
> Andrzej Lewandowski wrote:
>
> >......
> > object orientation and modules are in principle orthoogonal concepts,
and
> > that BOTH and SEPARATE are required to build well structured OO
programs.
>
> That�s interesting. Does that mean that adding, modifying or deleting an
> OO-object from a software system doesn�t effect the architecture of it as
> the architecture deals with components ( modules ) and their relationship?

Of course, if you define "architecture" in such a way as to deal only with
those things.  Otherwise, not.

> > C++, Eiffel, Smalltalk ond others are using classes for both purposes:
OO
> and
> > encapsulation (say, modularization).
>
> > Ada95 and Oberon are two (well, maybe not
> > the ONLY two...) languages that separate these two notions.
> >......
>
> and are therefore more expressive at the architectual level compared to
the
> first group languages?

Yes, they are more expressive at the architectural level.

>
> And to which group does Java with its interface and package constructs
> belong, the first or the second and why?

I think it falls somewhere in between.  Java is a class-oriented language,
so it has classes which capture the encapsulation aspect of modularity, but
it also has packages which capture the namespace aspect of modularity.
Interfaces don't really directly have to do with modularity, although they
can be used to separate interface from implementation which is an aspect of
modularity.  However, they seem not to intended to be used this way on a
fine-grained basis -- you typically see it up higher, at the component level
(whatever that is :-)

Mark Lundquist








^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OO and modules ( was Which book for ADA beginner ?)
  2001-01-29 15:58               ` James Rogers
@ 2001-02-02 22:07                 ` Mark Lundquist
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Lundquist @ 2001-02-02 22:07 UTC (permalink / raw)



James Rogers <jimmaureenrogers@worldnet.att.net> wrote in message
news:3A759385.6BDA29D8@worldnet.att.net...
> [...]
> C++ has added a new feature called name spaces to allow the
> use and identification of multiple classes with the same name in
> single program. This feature was added because the original concept
> of all encapsulation occurring only in the class was found to be
> too limiting, particularly when trying to use pre-defined libraries.

The result is that C++ has three different modularity constructs:

1) From C, the file.  File-based scoping along with extern declarations are
the basis for the ".h/.C" convention.  Direct textual inclusion of header
files with the problems that attend to that approach.  No semantic
relationship between the header file and the "implementation file" (i.e. it
is legal C/C++ for the implementation file to not fulfill all the
protoptypes as declared in the header file.  You will get a link error if
all the symbol references are not satisfied somehow).

2) Classes

3) Namespaces

So you have these three things that kind of overlap and don't seem to
complement
each other particularly well.  I don't like it that namespaces can be
textually extended, which means that they don't mean the same thing in all
places.

The main thing to remember is that C++, like C, is still a linker-based
language.

-- mark









^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: OO and modules ( was Which book for ADA beginner ?)
@ 2001-02-02 22:13 Mark Lundquist
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Lundquist @ 2001-02-02 22:13 UTC (permalink / raw)
  To: comp.lang.ada


Hans-Olof Danielsson <Hans-Olof.Danielsson@swipnet.se> wrote in message
news:mailman.980777779.24788.comp.lang.ada@ada.eu.org...
> Andrzej Lewandowski wrote:
>
> >......
> > object orientation and modules are in principle orthoogonal concepts,
and
> > that BOTH and SEPARATE are required to build well structured OO
programs.
>
> That�s interesting. Does that mean that adding, modifying or deleting an
> OO-object from a software system doesn�t effect the architecture of it as
> the architecture deals with components ( modules ) and their relationship?

Of course, if you define architecture to deal only with those things.

> > C++, Eiffel, Smalltalk ond others are using classes for both purposes:
OO
> and
> > encapsulation (say, modularization).
>
> > Ada95 and Oberon are two (well, maybe not
> > the ONLY two...) languages that separate these two notions.
> >......
>
> and are therefore more expressive at the architectual level compared to
the
> first group languages?

Yes, they are more expressive at the architectural level.

>
> And to which group does Java with its interface and package constructs
> belong, the first or the second and why?

I think it falls somewhere in between.  Java is a class-oriented language,
so it has classes which capture the encapsulation aspect of modularity, but
it also has packages which capture the namespace aspect of modularity.
Interfaces don't really directly have to do with modularity, although they
can be used to separate interface from implementation which is an aspect of
modularity.  However, they are not intended to be used this way on a
fine-grained basis -- you typically see it up higher, at the component level
(whatever that is :-)

Mark Lundquist






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-02-02 22:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-02 22:13 OO and modules ( was Which book for ADA beginner ?) Mark Lundquist
     [not found] <3A71400E.32057C6B@becker.k.pl>
     [not found] ` <slrn972q4p.k7.randhol+abuse@kiuk0156.chembio.ntnu.no>
2001-01-26 16:52   ` Which book for ADA beginner ? Brian Rogoff
2001-01-27  2:15     ` Andrzej Lewandowski
2001-01-28 13:43       ` Preben Randhol
2001-01-28 18:29         ` Brian Rogoff
2001-01-29  2:28           ` Andrzej Lewandowski
2001-01-29 14:03             ` OO and modules ( was Which book for ADA beginner ?) Hans-Olof Danielsson
2001-01-29 15:58               ` James Rogers
2001-02-02 22:07                 ` Mark Lundquist
2001-02-02 22:06               ` Mark Lundquist

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