comp.lang.ada
 help / color / mirror / Atom feed
* Object Oreinted Style
@ 2000-03-28  0:00 Michael Garrett
  2000-03-28  0:00 ` Dale Stanbrough
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Garrett @ 2000-03-28  0:00 UTC (permalink / raw)



I have seen two philosophies concerning "class" construction in Ada95.

In the RM, a class is defined as:

Class.  A class is a set of types that is closed under derivation, which
means that if a given type is in the class, then all types derived from that
type are also in the class. The set of types of a class share common
properties, such as their primitive operations.

and Package as:

Package.  Packages are program units that allow the specification of groups
of logically related entities. Typically, a package contains the declaration
of a type (often a private type or private extension) along with the
declarations of primitive subprograms of the type, which can be called from
outside the package, while their inner workings remain hidden from outside
users.

In "Object Oriented Software in Ada 95" Michael A. Smith uses the package as
a "class" construct, putting one tagged type and it's associated operations
into a single package, and derived types in there own top level ( NON
child  ) packages. He warns against breaking encapsulation rules by deriving
types in child packages. In the booch components, derived types are declared
included in child packages. In a large embedded system, which method would
make for more maintainable
code, one type per package, or a "class" multiple derived types?

--
Michael C. Garrett
Vice President Research and Development
Medical Research Laboratories
www.mrlinc.com
michaelgarrett@csi.com








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

end of thread, other threads:[~2000-04-02  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-28  0:00 Object Oreinted Style Michael Garrett
2000-03-28  0:00 ` Dale Stanbrough
2000-03-31  0:00   ` Magnus Larsson
2000-03-31  0:00     ` Dale Stanbrough
2000-04-02  0:00       ` Richard D Riehle
2000-04-02  0:00         ` David Botton

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