comp.lang.ada
 help / color / mirror / Atom feed
* Idiom for a class and an object in Ada
@ 2004-10-18 11:47 Marin David Condic
  2004-10-18 12:14 ` Martin Krischik
                   ` (4 more replies)
  0 siblings, 5 replies; 55+ messages in thread
From: Marin David Condic @ 2004-10-18 11:47 UTC (permalink / raw)


Suppose I have a class with one or a limited set of objects. The objects 
are "global" in the sense that they hang around from program startup 
thru the entire life of execution. An example would be an A/D Converter 
class - My little control box might have 3 or 4 A/Ds in it - they're 
always there and I want the data associated with them to be static (not 
declared on the stack.)

Question: What is the preferred Ada idiom for defining such a creature?

I have a package that defines the class - that contains the tagged type 
and any methods. I might:

a) Declare the objects within that "class" package

b) Declare the objects within some child package of the class package

c) Declare the objects in some global "Here's all my static data" 
package (not very tidy)

d) Declare the objects in the main program (not good if they are 
accessed by more than one task and also a kind of dumping ground)

Does anybody have an opinion or experience with doing this? I know what 
I've done in the past, but I'm curious if there is any preferred method 
or idiom for this in the OO paradigm as applied to Ada?

MDC
-- 
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/NSFrames.htm

Send Replies To: m   o   d   c @ a   m   o   g
                    c   n   i       c   .   r

     "Power corrupts.  Absolute power is kind of neat"
         -- John Lehman, Secretary of the Navy 1981-1987
======================================================================



^ permalink raw reply	[flat|nested] 55+ messages in thread
* Re: Idiom for a class and an object in Ada
@ 2004-10-21 13:59 Stephen Leake
  0 siblings, 0 replies; 55+ messages in thread
From: Stephen Leake @ 2004-10-21 13:59 UTC (permalink / raw)
  To: comp.lang.ada

Matthew Heaney <matthewjheaney@earthlink.net> writes:

> Jeffrey Carter <spam@spam.com> writes:
> 
> > Matthew Heaney wrote:
> > 
> > > For reasons I can't fathom, many Ada95 developers still have a very
> > > Ada83 mindset.
> > 
> > That's because Ada 83 was a very good language, and the idioms that were
> > good for it are still good.
> 
> Ancient history.

The mere fact that something is _ancient_ doesn't mean it's _bad_.
Here are some truly ancient facts:

2 + 2 = 4

a**2 + b**2 = c**2

F = M a

Will you dismiss those in the same way?

Please give real reasons why Ada 83 idioms are no longer useful.

--
-- Stephe

___________________________________________________________
This mail sent using ToadMail -- Web based e-mail @ ToadNet



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

end of thread, other threads:[~2004-10-22  5:37 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-18 11:47 Idiom for a class and an object in Ada Marin David Condic
2004-10-18 12:14 ` Martin Krischik
2004-10-18 19:40   ` Matthew Heaney
2004-10-19 12:59   ` Marin David Condic
2004-10-19 14:46     ` Martin Dowie
2004-10-19 15:55       ` Matthew Heaney
2004-10-19 18:31         ` Martin Dowie
2004-10-19 15:52     ` Matthew Heaney
2004-10-18 12:26 ` Marius Amado Alves
2004-10-19  2:09   ` Jeffrey Carter
2004-10-19  3:28     ` Matthew Heaney
2004-10-19 12:53       ` Marin David Condic
2004-10-19 14:44         ` Matthew Heaney
2004-10-19 15:01           ` Dmitry A. Kazakov
2004-10-19 15:40             ` Matthew Heaney
2004-10-20  7:58               ` Dmitry A. Kazakov
2004-10-20 12:31                 ` Marin David Condic
2004-10-20 13:53                   ` Dmitry A. Kazakov
2004-10-20 15:23                   ` Matthew Heaney
2004-10-21 12:24                     ` Marin David Condic
2004-10-21 17:15                       ` Matthew Heaney
2004-10-20  5:39         ` Simon Wright
2004-10-20  7:24           ` Matthew Heaney
2004-10-20  8:39             ` Dmitry A. Kazakov
2004-10-21  1:36             ` Jeffrey Carter
2004-10-21  1:46               ` Matthew Heaney
2004-10-21  7:51                 ` Dmitry A. Kazakov
2004-10-21 12:45                   ` Matthew Heaney
2004-10-21 14:11                     ` Dmitry A. Kazakov
2004-10-22  1:04                 ` Jeffrey Carter
2004-10-22  1:36                   ` Matthew Heaney
2004-10-21 19:31               ` Kevin Cline
2004-10-21 22:02                 ` Matthew Heaney
2004-10-22  0:10                   ` Matthew Heaney
2004-10-21  8:25             ` Martin Dowie
2004-10-20 17:04           ` Matthew Heaney
2004-10-20 19:37             ` Simon Wright
2004-10-20 20:04               ` Matthew Heaney
2004-10-22  5:37                 ` Simon Wright
2004-10-20  1:10       ` Jeffrey Carter
2004-10-20  7:04         ` Matthew Heaney
2004-10-20 12:42           ` Marin David Condic
2004-10-20 12:55             ` Matthew Heaney
2004-10-20 15:27             ` Matthew Heaney
2004-10-21  1:36               ` Matthew Heaney
2004-10-19 12:38   ` Marin David Condic
2004-10-18 16:59 ` Matthew Heaney
2004-10-18 18:02 ` Martin Dowie
2004-10-19 13:06   ` Marin David Condic
2004-10-19 14:51     ` Martin Dowie
2004-10-20 16:20 ` Michael Paus
2004-10-20 17:15   ` Matthew Heaney
2004-10-20 17:55     ` Michael Paus
2004-10-21 12:33   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2004-10-21 13:59 Stephen Leake

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