home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sw / componen / 154 < prev    next >
Encoding:
Text File  |  1992-11-06  |  1.9 KB  |  44 lines

  1. Newsgroups: comp.sw.components
  2. 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
  3. From: emery@Dr_No.mitre.org (David Emery)
  4. Subject: Re: Standard SW Interfaces (Was: Reuse Discussion Topics)
  5. In-Reply-To: kuhn@swe.ncsl.nist.gov's message of 5 Nov 92 19:00:41 GMT
  6. Message-ID: <EMERY.92Nov5165454@Dr_No.mitre.org>
  7. Sender: news@linus.mitre.org (News Service)
  8. Nntp-Posting-Host: dr_no.mitre.org
  9. Organization: The Mitre Corp., Bedford, MA.
  10. References: <1992Nov3.000359.17029@den.mmc.com> <6718@dove.nist.gov>
  11. Date: Thu, 5 Nov 1992 21:54:54 GMT
  12. Lines: 30
  13.  
  14. I think another characteristic of a good interface is how easy it is
  15. to express that interface in different programming languages.  This
  16. is because the 'abstraction' is a good match for the problem, and
  17. therefore it is easy to express the 'abstraction' in an arbitrary
  18. programming language.  Some examples taken from my recent experience
  19. with POSIX.1 and Ada:
  20.  
  21.     -  each API operation should perform only 1 abstract function
  22.         -- counter-example:  Unix fcntl()
  23.  
  24.     -  there should be a consistent use of types and values
  25.         -- counter-example:  C functions that return 
  26.            a pointer, but return "-1" for an error
  27.  
  28.     -  error handling models should localize the effects of
  29.        errors
  30.         -- the shared variable 'errno' causes problems in 
  31.            multi-threaded programs (both C and Ada)
  32.  
  33. I tend to be of the "it's best expressed in Ada" religion, but I've
  34. found that it *is* possible to express good interfaces in C, FORTRAN
  35. and even BASIC.  One thing the current move towards language
  36. independence might do is help develop interfaces that can support
  37. different software paradigms.
  38.  
  39. Right now I'm working on a binding to another system (defined in terms
  40. of its C language API), and this system is much less easy to express
  41. in Ada than the POSIX API was.  
  42.  
  43.                 dave
  44.