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

* Re: Renames: use of it....
  2002-11-26 10:37 Renames: use of it prashna
@ 2002-11-26 12:57 ` Marin David Condic
  0 siblings, 0 replies; 3+ messages in thread
From: Marin David Condic @ 2002-11-26 12:57 UTC (permalink / raw)


Looks like something that is not a syntactic necessity, so it was probably
done for some design reason. One excuse is that you may want visibility of
only certain things within a package from some subset of the whole system.
I'd bet money that the original designers didn't leave around much in the
way of design documentation, but if they did, that would be where you'd
likely see the rationale for the COMMANDS package, which would explain why
it exists with renames for things in ACTION_CONTROLER.

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

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

    "I'd trade it all for just a little more"
        --  Charles Montgomery Burns, [4F10]
======================================================================

prashna <vashwath@rediffmail.com> wrote in message
news:d40d7104.0211260237.64e4cddf@posting.google.com...
> 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

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