Usama
Usama

Reputation: 251

What is difference between procedural cohesion and sequential cohesion in Software Design Architecture?

Procedural cohesion says Parts of a module are grouped because they always follow a certain sequence of execution and Sequential cohesion says Parts of a module are grouped because the output from one part is the input to another part like an assembly line. These definitions are ambiguous. Please Explain.

Upvotes: 3

Views: 7590

Answers (2)

ANCHIT BHUSHAN
ANCHIT BHUSHAN

Reputation: 21

Both Sequential and procedural cohesion follow a sequence, the difference is that

  • In Sequential cohesion, the sequential flow is of the data flowing from one component to another component in the same module. e.g- data flowing from output of one component into input of another component of the same module.

  • In Procedural cohesion, the sequential flow is of the functionality i.e, a particular function has to performed before another function or in a certain order e.g - In opening a file, the first functionality is to check the file permissions and then open the file accordingly.So there is a certain order of functionality.

Upvotes: 2

Dhanik Lal Sahni
Dhanik Lal Sahni

Reputation: 437

In Sequential cohesion, activities are related and output for current activities is input for next activity but in procedural cohesion activities are unrelated.

Example for Sequential Cohesion : Let us take an example of getting data from database. Below will be steps for this task.
1. Get result set from sql command
2. prepare result set
3. return result set
In this example sequence is followed and each activity's result is input for next activity. If any of the activity is not executed successfully then next activity will not executed.

Example for Procedure Cohesion : Let us take example of above module.
1. create connection string
2. Open connection using SqlConnection class
3. Execute sql command suing SqlCommand
4. Get resultset using SqlDataReader

In this example record is fetched from database. We have to use SqlConnection, SqlCommand, SqlDataReader which is different in terms of functionality. But all of them make a complete procedure to get records from database.

Upvotes: 7

Related Questions