comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com (Tom Moran)
Subject: Re: [question] Ada and DataBase
Date: 1999/04/24
Date: 1999-04-24T00:00:00+00:00	[thread overview]
Message-ID: <3721434b.19630891@news.pacbell.net> (raw)
In-Reply-To: xo6U2.170$lA1.475@198.235.216.4

> I am wondering what is the meaning of thin
>or thick binding. I appreciate any explanation.
A thin binding has the underlying (C or whatever) functions rewritten
in Ada syntax, with appropriate pragma Imports.  Usually the names
have also been changed as little as possible from the original.  The
advantages include: little documentation (you can just go read the C
docs) and ease and speed of creation - in fact a substantial amount of
the work can be automated.  The disadvantages include: you are forced
to program in C with Ada syntax, ie at a very low abstraction level.
Usually it uses C idoms - pointers, 'address, no "out" parameters,
etc.
  A thick(er) binding is more Ada-like.  It usually utilizes Ada
capabilities like strong typing, tasking, protected records, etc etc.
You are using your Ada skills and getting help from the Ada compiler,
instead of using your C skills, and it feels like  it.  Typically the
abstraction level is much higher, and a lot of memory
allocation/deallocation, task safeness, etc stuff has already been
done for you by the author of the binding.  Last but not least, said
author has already discovered many of the things the C docs left out,
since he had to learn how things actually work.  The disadvantage is
that it isn't C so  it needs to be documented itself rather than just
refering you to the C books, and of course it takes a lot more work to
create. 
   Thickness varies of course.  A very thick binding often obscures
the differences between OSes, which can be good for portability, but
bad when you really need "that Windows look and feel" or some
capability that is so specific to one OS that the thick binding
doesn't even try to support it.  OTOH, a good thick binding should
allow ways to get at the underlying system and mix abstraction levels
when necessary without too much pain.
   I once suggested that thickness be measured in R values, like house
insulation.  Really thin is R1, near complete separation from the
external environment is, say, R50.  Someone counterproposed that
thickness could be measured by the ratio of sizes of the specs to the
bodies.  A thin binding has hardly any body, of course.
   I coauthored a paper on Claw, a thick Ada binding to Windows, at
the TriAda '97.  It discusses some of the issues and is available
online at www.rrsoftware.com  (I'd describe Claw as about R15-20, and
its package bodies total just under twice the specs.)





  parent reply	other threads:[~1999-04-24  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 ` David Botton
1999-04-23  0:00   ` Siamak.Lina
1999-04-23  0:00     ` me
1999-04-24  0:00     ` Tom Moran [this message]
1999-04-25  0:00     ` David Botton
1999-04-25  0:00     ` Siamak.Lina
1999-04-23  0:00 ` Paul Whittington
1999-04-23  0:00 ` Tom Moran
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