comp.lang.ada
 help / color / mirror / Atom feed
* Renames: use of it....
@ 2002-11-26 10:37 prashna
  2002-11-26 12:57 ` Marin David Condic
  0 siblings, 1 reply; 3+ messages in thread
From: prashna @ 2002-11-26 10:37 UTC (permalink / raw)


Hi all,
I am doing a code review for a one of the module in flight management
computer.
One the procedure is calling an another procedure
(COMMANDS.EXECUTE_SCROLL) from a package called COMMANDS.
In package COMMANDS the declaration of the procedure EXECUTE_SCROLL is
as follows :
procedure EXECUTE_SCROLL (MCDU_ID   : in
MMI_APPLICATION_TYPES.T_MCDU_ID;
                             DIRECTION : in CONTEXT_TYPES.T_DIRECTION)
renames ACTION_CONTROLER.EXECUTE_SCROLL;

All the procedures in this package is rename of a procedure in package
ACTION_CONTROLER or some other package. Why is it so?Why can't use the
procedure from the package ACTION_CONTROLER itself(i.e instead of
calling COMMANDS.EXECUTE_SCROLL why can't they use
ACTION_CONTROLER.EXECUTE_SCROLL)?Is the package COMMANDS really
required?

Thanks in advance,
ashwath



^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: Renames: use of it....
@ 2002-11-26 11:21 Grein, Christoph
  0 siblings, 0 replies; 3+ messages in thread
From: Grein, Christoph @ 2002-11-26 11:21 UTC (permalink / raw)


> Hi all,
> I am doing a code review for a one of the module in flight management
> computer.
> One the procedure is calling an another procedure
> (COMMANDS.EXECUTE_SCROLL) from a package called COMMANDS.
> In package COMMANDS the declaration of the procedure EXECUTE_SCROLL is
> as follows :
> procedure EXECUTE_SCROLL (MCDU_ID   : in
> MMI_APPLICATION_TYPES.T_MCDU_ID;
>                              DIRECTION : in CONTEXT_TYPES.T_DIRECTION)
> renames ACTION_CONTROLER.EXECUTE_SCROLL;
> 
> All the procedures in this package is rename of a procedure in package
> ACTION_CONTROLER or some other package. Why is it so?Why can't use the
> procedure from the package ACTION_CONTROLER itself(i.e instead of
> calling COMMANDS.EXECUTE_SCROLL why can't they use
> ACTION_CONTROLER.EXECUTE_SCROLL)?Is the package COMMANDS really
> required?

This looks very much like a design issue, probably Ada 83. I presume 
ACTION_CONTROLER has more operations than EXECUTE_SCROLL, but only those made 
visible in COMMANDS via renaming statements shall be visible to the outside. So 
there is probably a coding guideline that clients shall use COMMANDS only and 
not ACTION_CONTROLER directly.

This is work-around for the (in Ada 83) missing feature of private children. 
Also in Ada 95, sometimes you cannot make everything private as you would like 
to, so such a rule helps to limit visibility.

In our project, we use a lot of such renaming packages.



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

end of thread, other threads:[~2002-11-26 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-26 10:37 Renames: use of it prashna
2002-11-26 12:57 ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2002-11-26 11:21 Grein, Christoph

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