[Prev][Next][Index][Thread]

Re: A basic question: defining modules and libraries



In article
<Pine.GSO.3.96.1000328164553.23489F-100000@tardis.tardis.ed.ac.uk>, Hugh
Greene <q@tardis.ed.ac.uk> wrote:

> >  A related improvement may be to add versioning information in the
> > "define library" or in a new "define deliverable" top-level macro.
> 
> Again, this might be better out-of-language, e.g., in LID files.  I only
> know enough about versioning to know that it's harder than it seems.
> Maybe looking at how existing systems (*nix shared libs, Win32 DLLs,
> CORBA, COM) handle it would point us to some "best practice".

MacOS does a very nice job of versioning DLLs ("Shared Libraries" as the
Finder calls them, or "Code Fragments" as the OS documentation calls
them).

First: the system totally ignores the *name* of the file.  All DLLs in the
serach path are examined to see what the module name stored inside them
is.

Second: each library has a version number and also the oldest version with
which it is API-compatable.

Third: the executable knows which version it was linked against and also
the oldest version it is compatable with.


At runtime, the actual DLL used may be the same as the application was
linked against, older (if the application says it is compatable with it),
or newer (if the library says it is API-compatable with the version the
application was linked against).  There can be any number of versions of
the same library present, and the newest one that is compatable is used. 
Other applications running at the same time may well be using different
versions of the same library.


The full story is available in Chapter 3 of _Inside Macintosh: PowerPC
System Software_ at:

   <http://devworld.apple.com/techpubs/mac/PPCSoftware/PPCSoftware-40.html>

-- Bruce



References: