Proposal and RFC: DAL, the Desktop Abstraction Layer

David Collier-Brown davec-b at rogers.com
Sat Jan 15 22:39:05 EET 2005


Havoc Pennington wrote:
> Versioning of interfaces is pretty simple: once something is published
> you can't change it without renaming it.
                                           [1]
>                                       Well, for D-BUS we can probably
> be more liberal and say you can't remove or change methods; adding
> methods/fragile-base-class should be irrelevant in a D-BUS context.
> 
> I've absently thought about a couple ideas to make all this cleaner:
> 
>  - some way to mark interfaces as published/unpublished and throw 
>    an error if third party apps look at unpublished; but I can't figure
>    out how to define "third party" or detect it

  Rewinding my brain back to my Multics days, the binder only
allowed official published interfaces to be linked to by 
applications.  If you were part of the libraries that made up
the layer, you linked to the libraries before they were 
bound.

  In the Unix/C world, this was conventionally simulated via playing
with names.  read() is a normal interface, _read() is one reserved for
internal use, and __read, ___read and so on are treated the same as
_read.
  Solaris has a tool, appcert, which checks for use of reserved
interfaces, as part of the normal versioning scheme, and reports
use of the reserved ones by applications.

  There is an elegant way, assuming you're using ELF or better: write
a filter library that exports only the public interfaces to external
callers, and only document the filtered interfaces and the filter
library.  This causes one extra lookup and open when the library
is first used, but no extra work once that's done.

--dave
--
[1: A quibble: Multics used to version-number structures
    so that they could write auto-updater and downdater 
    code and avoid flag-days entirely when the data required
    for a given interface needed to change. This allowed them
    to change the filesystem layout one without us users even
    noticing it.]

David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
davecb at spamcop.net           |                      -- Mark Twain



More information about the xdg mailing list