comp.lang.ada
 help / color / mirror / Atom feed
From: Mace Ayres <mace.ayres@gmail.com>
Subject: Why *.adb and *.ads?
Date: Mon, 1 Jan 2018 17:27:51 -0800 (PST)
Date: 2018-01-01T17:27:51-08:00	[thread overview]
Message-ID: <fcaa8e1f-5d71-46f8-a668-f5ff2480291f@googlegroups.com> (raw)
In-Reply-To: <ef3c5e22-3f43-473a-9852-232d4196ba2a@googlegroups.com>

Andrew, you may think of the *.abs and *.abs as source code in the tradition way. The *.ads is the speficition (the ‘s’ of ads) file, which specifies the sub programs (functions, procedures) types, and other components of the (package).
The corresponding *.adb in the full body, elaborated, details of the specifications (promise of functions, procedures, types, etc.) specified in the *abs specification.

This provides rigorous delivery of the abstraction aspect of Ada. Think of hiring a very reliable consultant to build x, which will various things in a safe and reliable way. The contract you sign promises the WHAT will be delivered, the specifications in the *abs file. The contractor plans, schedules, gather resources and supervises the delivery of the specification. 

You don’t need to see all the details of how the work is done. In fact you, or other components of the overall program, don’t want to know. If the contractor uses Bob instead of Alice to do part of x, you don’t care as long the the specification of delivery remains consistent.

test.abs ..
procedure say_hello (message :string in out);
end test;  — speficiation

test,adb ———————-
Procedure say_hello is
Begin
put_line(message);
end test.  — body

to use procedue say_hello somewhere, I have”
If happy then 
  say_hello (“i am happy”);
else
  say_hello(“Not so happy”);
end if;
The details of the implementation of say_hello may change in the body *.adb, as long as the procedure definition in the *.abs and *adb domain the same.

t


  parent reply	other threads:[~2018-01-02  1:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 20:15 Why *.adb and *.ads? Andrew Shvets
2018-01-01 21:00 ` Jeffrey R. Carter
2018-01-02  1:50   ` Mace Ayres
2018-01-02  1:27 ` Mace Ayres [this message]
2018-01-27 15:45 ` Norman Worth
2018-01-27 16:37   ` Dennis Lee Bieber
2018-01-27 22:18     ` [OT] VMS editors and PC keyboards, was: " Simon Clubley
2018-01-27 16:40   ` Mace Ayres
replies disabled

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