Computer Science, asked by ggghh9423, 1 year ago

"if a module has logical cohesion", what type of coupling is it likely to have with other modules.

Answers

Answered by mahipujari
4


Coincidental cohesion:-

This occurs when there is no relationship among elements of a module. They can occur if an existing program modularized by chopping it into pieces and making differ piece of modules i.e. it performs a set of tasks that are related to each other very loosely. The modules contain a random collection of function.

Logical cohesion:-

A module having logical cohesion if there are some logical relationship between elements of a modules i.e. elements of a module performs the operation.

Temporal cohesion:-

It is same as logical cohesion except that the element must be executed in same time. Set of function responsible for initialization, startup, the shutdown of the same process. It is higher than logical cohesion since all elements are executed together. This avoids the problem of passing the flag.

Communicational cohesion:-

A module is said to have Communicational cohesion if all function of module refers to an update the same data structure.

Sequential cohesion:-

A module is said to have sequential cohesion if element module from different parts of the sequence. When the output from one element of the sequence is input to the next element of a sequence. A sequence bounded module may contain several functions or part of different functions.

Functional cohesion:-

It is the strongest cohesion in a functional bound module, all elements of the module are related to performing a single function. By function we not mean simply mathematical function but also these modules which have single goal function like computing square root and sort array are a clear example of functionality cohesion modules


NOW COUPLING


Coupling:- Coupling is a measure that defines the level of inter-dependability among modules of a program. It tells at what level the modules interfere and interact with each other. The lower the coupling, the better the program.



There are five levels of coupling are:-

• Content coupling - When a module can directly access or modify or refer to the content of another module, it is called content level coupling.

• Common coupling- When multiple modules have read and write access to some global data, it is called common or global coupling.

• Control coupling- Two modules are called control-coupled if one of them decides the function of the other module or changes its flow of execution.

• External Coupling: This type of coupling occurs when an external imposed data format and communication protocol are shared by two modules. External Coupling is generally related to the communication to external devices.

• Message Coupling: This type of coupling can be achieved by the state decentralization. It is the loosest type of coupling, in which the component communication is performed through message passing.

• Stamp coupling- When multiple modules share common data structure and work on different part of it, it is called stamp coupling.

• Data coupling- Data coupling is when two modules interact with each other by means of passing data (as parameter). If a module passes data structure as parameter, then the receiving module should use all its components.


Answered by kirankaurspireedu
0

Answer:

It is the loosest sort of coupling, in which message passing is used for component communication.

A module is said to be logically coherent if its constituents carry out similar tasks and the tasks to be carried out are chosen outside the module. When modules' components are grouped together despite the fact that they are inherently diverse, this is known as logical cohesiveness.

The amount of interaction of two classes or operations that violates the information-hiding principle is known as coupling.

Explanation:

A programme is more modular the lesser its coupling, which requires less coding modification when the project's functionality is subsequently changed. Objects and classes are interdependent when there is tight connection. In general, close link is bad since it limits the code's flexibility and reusability, whereas loose coupling means less dependencies between classes that use other classes directly.

Module coupling is the process of connecting two or more modules to the outside world and each other. In general, it depicts the connections between the modules and outside world. Cohesion and coupling go hand in hand.

#SPJ2

Similar questions