comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: networking support?
Date: Fri, 19 Dec 2008 13:49:27 -0800 (PST)
Date: 2008-12-19T13:49:27-08:00	[thread overview]
Message-ID: <eb9a0c32-c108-41b6-8ae6-92165b882d4a@l33g2000pri.googlegroups.com> (raw)
In-Reply-To: 494a4655$0$30220$9b4e6d93@newsspool1.arcor-online.net

On 18 Gru, 13:47, Georg Bauhaus <rm.dash-bauh...@futureapps.de> wrote:

> How would your program benefit from first wrapping system
> functions (that use C conventions) in C++ classes only for
> having to match Ada's O-O types and C++'s O-O types in
> a second step?
> Seems like an artificial setup to me.

Except that a lot of things in the C world (especially in the system
APIs) are defined in header files as preprocessor constants, optional
or even unofficial structure fields or field order within a struct -
all this means that the binary layout of data structures is a big
question mark. This problem is particularly notorious with network
services.
There is no way to reasonably interface with all this mess from Ada
and having a wrapper layer that fixes some of this optional/unofficial/
ordering stuff for the Ada part is a valid option.
Now the question is how thick this adapter layer should be - and here
a layer that does a bit of lifetime management or error reporting in
addition to just parameter passing is also a valid solution.
Then you might discover that all the work that is done in this
adapting layer can be reused in C++ projects as well (it is a low-
hanging fruit, so why not benefit from it?) and you end up with a
regular C++ library that encapsulates some system services and is used
from the Ada program.
There is nothing artifical in it - it starts with a fundamental
feasibility issues and ends up with simple economy.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

Database Access Library for Ada: www.inspirel.com/soci-ada



  reply	other threads:[~2008-12-19 21:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 18:33 networking support? Oliver Kowalke
2008-12-18  9:28 ` Georg Bauhaus
2008-12-18 11:55   ` Oliver Kowalke
2008-12-18 12:47     ` Georg Bauhaus
2008-12-19 21:49       ` Maciej Sobczak [this message]
2008-12-19 23:05         ` Oliver Kowalke
2008-12-20 19:23           ` Maciej Sobczak
2008-12-21 17:57             ` Oliver Kowalke
2008-12-21 22:21               ` Maciej Sobczak
2008-12-19 23:57         ` Georg Bauhaus
2008-12-18 18:09   ` Jeffrey R. Carter
2008-12-18 18:30     ` Georg Bauhaus
2008-12-18  9:54 ` Jacob Sparre Andersen
2008-12-18 16:14 ` anon
replies disabled

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