[an error occurred while processing this directive]
The concepts of cohesion and coupling are important consideration in the design of a module. You should aim for a module that be easily used and understood without having to understand the implementation.
This section should be brief. Consider the following questions. From the answers, select a few sentences that serve best to help a programmer identify the kind of role that the module plays.
If the module maintains some internal state that the client needs to be aware of, it should be mentioned here. For example, most input processing modules keep track of current position in the input. Many errors in the use of input processing modules arise from imprecise specification of when the current position is advanced. Be sure to mention functions that need to be called before the internal state is meaningful. For input processing modules, the current position may not be meaningful until a client has called one of the module functions.
If there are limitations and restrictions on the use of the module they should be mentioned towards the end of this section. This is also a good place to indicate error handling policies.
Although the information in this section is important client information, it may depend on implementation decisions about the breakdown of the module into submodules and the determination of other modules that are used by this module. You may have to wait until you have done some preliminary work on implementation specifications before filling this in.
If you return a complex data type (or a pointer to a complex data type) then the client should be able to use functions to get at individual parts of the data. You can either document those functions as part of this module or document them as a separate module.
Clarity, precision, and conciseness are important qualities to consider here. These quality factors are dependent on the design of the functions as well as the words that you use to describe them. You should spend considerable time working on the design before writing these specifications. See Developing Client Interfaces with Communication Simulations for a methodology for developing your design.
You can often make function specifications clear and concise without sacrificing precision by using concepts defined in the Client Data Model section.
If you find that you cannot precisely specify a function in a few sentences then you are probably trying to do too much with it - it is incohesive. Reevaluate the function to see if it can be broken up into more primitive functions.
You can often make function specifications clear and concise without sacrificing precision by using concepts defined in the Client Data Model section. If you find that there are repeated lengthy phrases in the function specifications then introduce terminology in the Client Data Model section to simplify the repetion.
When appropriate, be sure to specify carefully whether return values are shared references or distinct copies. For example, suppose a module returns character strings. The module could either be returning a shared reference to a single character array variable that is used over and over with different contents or it could return a distinct dynamically allocated copy for each call. If the strings are to be used as keys in a lookup table then the client needs distinct copies. Otherwise, all keys end up refering to the same string.
Your module may have functions that are intended for internal use. These functions should not be mentioned here. They will be included in the module implementation specifications.
[an error occurred while processing this directive]