View Single Post
Old Aug 27th, 2005, 5:55 AM   #6
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by linuxpimp20
so they aren't really similar but closely tied? An API is rules on how to use a library? Does that mean it is another layer between the library and program so the program is more modular and if it need to be ported to use a new library you just have to alter the API? thanks for your quick replies.
The API is, as the name states, the interface specification. It specifies how the application programmer should use the library and the behaviour of the library in reaction to calls. For a call to a function, pre-call states and post-call states are defined, parameter types, return types, events, error codes, etc. etc. It does not, in accordance with the 'black box' principle, explain what goes on INSIDE the library. This information should not be necessary, and if the library developer were to change the internal design, it could possibly be harmful.
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote