The computer scientist David Parnas described two principles to guide the proper development and use of modules. First, one must provide the intended user of a module with all the information needed to use the module correctly, and with nothing more. Second, one must provide the implementor of a module with all the information needed to complete the module, and nothing more.
The emphasis is placed on the final negation clauses. This is very much like the military doctrine of ``need-to-know'', if you don't need to know some bit of information, then it should not be necessary for you to have it.
By following Parnas's principles one can create modules that have very little connection to their application, and can therefore be moved from one application to the next.