Computer Science, asked by sayliujawane7768, 1 year ago

Assume there is a method with the following signatures: retrieveCustomerAddress() void printAddressOfCustomer(char* address) retrieveCustomerAddress() retrieves the address of the customer from the database and pass it to the printAddressOfCustomer method that takes only the address of the customer and prints it in the console. What type of coupling is exhibited between these two modules?

Answers

Answered by pesh20gathoni
1

Answer:

The Given Example is Data Coupling.

Explanation:

retrieveCustomerAddress() and printAddressOfCustomer(char* address) this modules are communicate by passing only data. i.e. the dependency between this two functions is only based on the fact that they communicate by passing only data.

For your information below are different types of Coupling :

Types of Coupling:

  • Data Coupling: If the dependency between the modules is based on the fact that they communicate by passing only data, then the modules are said to be data coupled. In data coupling, the components are independent to each other and communicating through data. Module communications don’t contain tramp data. Example-customer billing system.
  • Stamp Coupling In stamp coupling, the complete data structure is passed from one module to another module. Therefore, it involves tramp data. It may be necessary due to efficiency factors- this choice made by the insightful designer, not a lazy programmer.
  • Control Coupling: If the modules communicate by passing control information, then they are said to be control coupled. It can be bad if parameters indicate completely different behavior and good if parameters allow factoring and reuse of functionality. Example- sort function that takes comparison function as an argument.
  • External Coupling: In external coupling, the modules depend on other modules, external to the software being developed or to a particular type of hardware. Ex- protocol, external file, device format, etc.
  • Common Coupling: The modules have shared data such as global data structures.The changes in global data mean tracing back to all modules which access that data to evaluate the effect of the change. So it has got disadvantages like difficulty in reusing modules, reduced ability to control data accesses and reduced maintainability.
  • Content Coupling: In a content coupling, one module can modify the data of another module or control flow is passed from one module to the other module. This is the worst form of coupling and should be avoided
Similar questions