comp.lang.ada
 help / color / mirror / Atom feed
From: me@me
Subject: Re: [question] Ada and DataBase
Date: 1999/04/23
Date: 1999-04-23T00:00:00+00:00	[thread overview]
Message-ID: <7frg70$l0g@drn.newsguy.com> (raw)
In-Reply-To: xo6U2.170$lA1.475@198.235.216.4

In article <xo6U2.170$lA1.475@198.235.216.4>, "Siamak.Lina" says...
>
 
>
>Sorry for my stupid question but I am wondering what is the meaning of thin
>or thick binding. I appreciate any explanation.
>
>
 
Assume you have some C layer of software (or any other language), with n 
API's (functions) defined on it that clients can use, this layer is meant
to be called by a C linkage interface. So, if you want to also to call
this same layer from Ada, you need an Ada binding (a small layer
of software that sits between the Ada program, and the C layer). an Ada 
thin binding means to have an Ada API that maps 1:1 each one of those 
'native' C calls to an Ada call.

So the Ada API (the small layer of binding software) that you see in 
your Ada program is very much like the C API, so using the Ada thin 
binding is very easy if you know the C API, and you can then 
use the C API documentation as well. (Ada bisning calls uses same number
of arguments, same error return status etc.. to large extent).

In a Thick API, the Ada API (the binding) is not a 1:1 mapping, it is a
new API (form the Ada client point of view) to the lower C layer, where 
one Ada call, can end up calling a number of those underlying C API 
calls, i.e. the Ada binding is  meant to both allow you to interface 
to the C layer, and also simplify the interface and to project a higher 
level of view/abstraction to the system.
 
Usually a thick binding will contain less calls than the C API. (that is the
is called think, the Ada think API will do more work internally and has
more logic in it than the thin one).

The disadvantage of this, is that it is a new API, different
than the one most people are used to, and requires new documentaions. The
advantages, is that you can give the thick API an Ada look and feel to it,
since you are free to not to use the same way the C API was designed, and also
you can hide more detailes from the user. (you can for example throw an
expection, where the C API might have returned an error status, etc..)

hope this helps.
 
me.





  reply	other threads:[~1999-04-23  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-23  0:00 [question] Ada and DataBase S. Metzger
1999-04-23  0:00 ` Tom Moran
1999-04-23  0:00 ` David Botton
1999-04-23  0:00   ` Siamak.Lina
1999-04-23  0:00     ` me [this message]
1999-04-24  0:00     ` Tom Moran
1999-04-25  0:00     ` Siamak.Lina
1999-04-25  0:00     ` David Botton
1999-04-23  0:00 ` Paul Whittington
1999-04-26  0:00 ` Fr�d�ric BROUARD
replies disabled

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