Types of Coupling
Mostly high levels of coupling happen when modules are tied to an environment external to software. Example for Input and Output couples a module to exact formats, devices and communication protocols. External coupling is essential but also happen when a number of modules reference a global data area. The general coupling as this mode is called is defined in figure 19.3. The Modules c, g and h each access a data item in a global data area example for a Fortran COMMON, disk file, and external data kind in the C programming language. The Module c initializes the item. In Later module g recomputed and updates the item. Let's suppose which an error occurs and g updates the item not correct. Much later in processing, module k reads the item attempts to procedure it and fails causing the software to terminate. The apparent cause of abort is module k the actual cause, module g. diagnosing problems in structures with considerable common coupling is time- consuming and hard. Moreover this does not mean which the use of global data is necessarily bad. It does mean which a software designer must be aware of potential consequences of general coupling and take special care to guard beside them.
The highest degree of coupling content coupling happens when one module makes use of control or data information maintained within the boundary of another module. Secondly, content coupling happens when branches are made into the middle of a module. This mode of coupling should and can be avoided.
The coupling modes discussed above occur because of design decision made when the program structure was build. The Variants of external coupling, however, may be introduced during coding. Example for compiler coupling ties source code to specific and often nonstandard attributes of a compiler operating system (OS) coupling ties design and resultant code to operation system hooks which can establish havoc when OS changes occur.