comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Smeets <VSmeets@meppen.sema.slb.com>
Subject: Re: Example of OSI package/data structure?
Date: Wed, 28 Nov 2001 11:47:06 +0100
Date: 2001-11-28T11:47:06+01:00	[thread overview]
Message-ID: <3C04C0AA.70073D03@meppen.sema.slb.com> (raw)
In-Reply-To: y22N7.7882$Ju6.2022995@news20.bellglobal.com

Thank you for your reply. I will explain why I was thinking about type
extension but I also will try to redesign using separate packages
side-by-side. You have made me think in an other direction.

Patrick Hohmeyer wrote:
> 
> Hmm, no help, just some hints ;-)
> 
> Why do you want Data_Link inherit from Physical ?

I was thinking of Physical being a channel (line) and Data_Link
extending it with the ability to transfer data over that channel
(defining Send and Receive procedures).

> This would give Data_Link the same interface as Physical
> plus an addition.
> Is that what you want ?
> Shouldn't Data_Link and Physical be two complete different interfaces.
> 
> And it would label Data_Link an extention of Physical.
> But aren't in the OSI philosophy these two *independent* layers,
> communication with each other through an interface?
> 
> I simply dont see my Browser as an extended Ethernet card.
> IMHO he _uses_ the Ethernet card, but he _is_ _not_ an Ethernet card.

I see your browser and ethernet as a channel to transfer data. The
browser sends and receives special formatted data and the ethernet
transfers just data. The browser extends the ethernet with the
processing of e.g. http/html.

> But if you want to go with your "extention" vision,
> tagged types and the first package structure are appropriated.
> 
> I recommend the "use" vision.
> There the third structure and no tagged types are recommended.
> 
> The "extention" vision makes it very hard to have 2 Data_Link go over
> the same physical device, as they are an extention of a Device,
> so 2 different Data_Links _are_ 2 (different) physical devices
> and I dont see how you are gonna solve this paradox.
> 
> That's why I'd prefer the "use" approch.
> 
> First question :
>   Why do you want to limite you to 2 vars in the ads?
>   Might it be possible that you will reuse the package on
>   a system with more than 2 devices?

not without a software change.

> Second :
>   When the user cant define variables, how is he supposed to
>   work with the type?
>   What you really want is not preventing the /definition/ of variables,
>   but the /initialization/ of variables.

I was thinking of allowing something like:
	Data_Link.Send (
		Channel => Physical.Device_1'Access,
		Data    => "data");

> Limited private is a good choice for the type.
> Then you need an initialization procedure
> (a function or constant wont work, as the user cant assign anything)
> something like :
> procedure Init_Device (Device_To_Init : out Device;
>   Device_Number : in Natural);
> and when Device_Number is greater than the number of devices
> in this implementation, you raise an exception.

I know the way of using limited types but then you have to control the
number of open instances. I was thinking of having only two instances
that are always open. That way I can leave out the controlling code.

> This one lets the user point two variable Device
> to the same physical device.
> To prevent this, you may mark a Device "occupied" until
> it is liberated with a second function.
> Think like a file.
> You may even use an only slighly modified Sequentiel_IO.ads for
> the specification of the Physical package.
> 
> > I hope you have enough information. Can you give me some help or point
> > me to an example?
> >
> > Thanks,
> > Vincent
> >
> 
> --
> Patrick Hohmeyer

-- 
Vincent Smeets
SchlumbergerSema -
Competence Center Informatik GmbH 
Lohberg 10 - 49716 Meppen - Germany
tel:  +49 5931-805-461
fax:  +49 5931-805-175
mail: VSmeets@slb.com
web:  www.cci.de



  reply	other threads:[~2001-11-28 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-28  8:28 Example of OSI package/data structure? Vincent Smeets
2001-11-28  9:46 ` Patrick Hohmeyer
2001-11-28 10:47   ` Vincent Smeets [this message]
2001-11-30  8:46     ` Patrick Hohmeyer
2001-11-28 11:15 ` David C. Hoos
2001-11-28 11:59 ` Larry Kilgallen
2001-11-28 12:06 ` Lutz Donnerhacke
2001-11-28 14:49   ` Vincent Smeets
replies disabled

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