INB221 Lecture Notes - Lecture 3: Logarithm, Linear Search, Linked Data Structure
Document Summary
Interfaces are a common boundary between two distinct entities. In the physical world, think about the surface of a river. There"s an "air to water" interface, a separation of the avian world and the marine world. In programming, it"s a conceptual boundary between the implementation of libraries. Its purpose is to provide information needed to use the library without revealing the implementation details, so at any time you can alter the interface, and the client programs that use the interface don"t change. The interface needs to be a part of the program. The way it"s done in c++ is by separating the functionality of an interface into a "header file". Uses the lib. h file to get definitions from the library. lib. h. The interface contains only the information about the library that the clients need to know. lib. cpp. The implementation contains the code to make the library work, the details of which are no use to clients.