Designing API

We've looked at some guidelines and tips for drawing module boundaries and creating modules. How about the process of creating APIs? This might seem obvious, but the standard best practice of a separate public API and private implementation still applies here.

The goal when designing the module API is to expose a standard, consistent, and possibly unchanging programming interface as the public API of the module. The details of implementation that are internal to the module should be encapsulated. This is, in principle, no different from method and member variable encapsulation for classes. Design a public API for your modules that you want the consumers to work with. The implementation details are hidden in encapsulated packages and serve two purposes:

  • To reduce and simplify effort for the consumer so that they don't have to know the internals
  • To allow the module to change and evolve the implementation without having an impact on the consumers of the module
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.107.193