comp.lang.ada
 help / color / mirror / Atom feed
From: Adrien Plisson <aplisson-news@stochastique.net>
Subject: Re: Plugins/Dynamic Libraries
Date: Thu, 11 Nov 2004 11:34:16 +0100
Date: 2004-11-11T11:34:16+01:00	[thread overview]
Message-ID: <41933fb1$0$9742$ba620e4c@news.skynet.be> (raw)
In-Reply-To: <419313b1$0$31235$9a6e19ea@news.newshosting.com>

Andrew W wrote:

> Under Linux the accepted method is using the DLibs bindings to dlopen etc
> http://www.cyberdanx.co.uk/ada95/dlibs.html
> 
> Under Windows the accepted method is using COM
> http://www.gnavi.org/gnatcom/

well, let's relieve the pain:
for dynamic libraries under Windows, the accepted method is _NOT_ COM ! 
the equivalent of Windows COM under Linux may be CORBA, and the 
equivalent of Linux dlopen under Windows is LoadLibrary.

these are 2 totally different approaches to the problem:
- LoadLibrary and dlopen allows to load a module whose structure is 
already known through the use of header files, .def files and other 
documentations. the module itself does expose fully the name of the 
methods it contains (it may expose it, often decorated) nor the name or 
types of arguments to those methods. it is the programmer responsability 
to check that his header file correspond exactly to the version of the 
module he is trying to use, and the compiler will check that arguments 
types to method calls are correct.

- COM and CORBA allows to load modules whose structure and content is 
unknown. the module exposes fully its name, version, methods and other 
definitions. for each method, it also exposes the type of arguments in a 
rather descriptive way. this allows to plug an unknown module into an 
application at runtime. it also allows to plug a module which was not 
existing at the time the application was written.

so LoadLibrary an ddlopen are lightweight runtime dynamic library 
mechanisms whereas COM and CORBA are heavyweight dynamic library mechanisms.

if you plan on working on this subject, try to use equivalent mechanisms 
on each platform you target.

please note that there are many bindings to those methods existing: 
PolyORB, AdaBroker or ORBIT-Ada are CORBA implementations, DLib for 
dlopen, LoadLibrary should be accessible through Win32Ada, and for 
COM... well, i don't know...

-- 
rien




  parent reply	other threads:[~2004-11-11 10:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 20:46 Plugins/Dynamic Libraries Andrew W
2004-11-11  8:28 ` Martin Krischik
2004-11-11 10:49   ` Adrien Plisson
2004-11-11 12:42     ` Frank Piron
2004-11-11 13:59     ` Martin Krischik
2004-11-11 16:16       ` Pascal Obry
2004-11-12  0:00   ` David Botton
2004-11-12 18:17     ` Pascal Obry
2004-11-11 10:34 ` Adrien Plisson [this message]
2004-11-12  0:12   ` David Botton
2004-11-12  9:53     ` Adrien Plisson
2004-11-14  3:38       ` David Botton
2004-12-04 14:27 ` Lionel Draghi
replies disabled

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