home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sw.components
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!linus!linus.mitre.org!linus!mbunix!emery
- From: emery@Dr_No.mitre.org (David Emery)
- Subject: Re: Standard SW Interfaces (Was: Reuse Discussion Topics)
- In-Reply-To: kuhn@swe.ncsl.nist.gov's message of 5 Nov 92 19:00:41 GMT
- Message-ID: <EMERY.92Nov5165454@Dr_No.mitre.org>
- Sender: news@linus.mitre.org (News Service)
- Nntp-Posting-Host: dr_no.mitre.org
- Organization: The Mitre Corp., Bedford, MA.
- References: <1992Nov3.000359.17029@den.mmc.com> <6718@dove.nist.gov>
- Date: Thu, 5 Nov 1992 21:54:54 GMT
- Lines: 30
-
- I think another characteristic of a good interface is how easy it is
- to express that interface in different programming languages. This
- is because the 'abstraction' is a good match for the problem, and
- therefore it is easy to express the 'abstraction' in an arbitrary
- programming language. Some examples taken from my recent experience
- with POSIX.1 and Ada:
-
- - each API operation should perform only 1 abstract function
- -- counter-example: Unix fcntl()
-
- - there should be a consistent use of types and values
- -- counter-example: C functions that return
- a pointer, but return "-1" for an error
-
- - error handling models should localize the effects of
- errors
- -- the shared variable 'errno' causes problems in
- multi-threaded programs (both C and Ada)
-
- I tend to be of the "it's best expressed in Ada" religion, but I've
- found that it *is* possible to express good interfaces in C, FORTRAN
- and even BASIC. One thing the current move towards language
- independence might do is help develop interfaces that can support
- different software paradigms.
-
- Right now I'm working on a binding to another system (defined in terms
- of its C language API), and this system is much less easy to express
- in Ada than the POSIX API was.
-
- dave
-