Here We Disucss 5 Criteria and Rules for Modularity
Decomposition normally means split something into small parts. Normally it is conducted for the big things. When we use term decomposition in programming language it means divided big program into small parts. In this methodology we see what portion of the domain we use for the individual module.
We make a hierarchy model to simplify the hierarchy of the modules.
SO as show above we split modules in some pattern like this. In this way the modules are related with one another. The relation of modules are defined in two terms which are Cohesion and Coupling.
To make proper decomposition you must understand these two terms so we discuss it now.
You are reading Software engineering Blogs.
In simple words we can say that when we divide modules in such way that modules does not depend on one an other. So this is called cohesion. When the modules does not related with one another for communication it makes their hierarchy simple. And it is easy to understand. It is very good approach.
Coupling is opponent to the cohesion. When the modules depend on one another then it means the modules are highly couple. Here one stage may occur which is called Temporal Cohesion.
Cohesion occur for a small time is called temporal cohesion.
One module may perform multiple functionality. It is possible that one functionality of modules does not related to other module. So the time in which this functionality runs then we can say that there is temporal cohesion.
As we know that each activity is also have its reverse. So here composition is the reverse activity of decomposition. In this step we create complete object by combine multiple modules.
Composition is conducted for the purpose of reusability.
When we analyze the subprogram libraries we can see that they are design by the composition of modules.
We represent in this way for example there are there are 3 modules A , B and C. we can write in this way AlBlC
Modular Understand ability:
When we develop or design something we always try to make every thing simple. So similarly here we must follow this step we have to create such modular hierarchy that is easy for the developer to understand. It saves time to understand the pattern.
There is also one solution to resolve this problem. It is also not possible to make every structure easy. So if we the structure is complex we can document the problem.
When we divide modules they are related in some way. So if we change some value that uses in all modules. And it makes changes in all modules this methodology is called Modular continuity.
For example in programming language we have 5 modules. And there is one variable that used in all modules . If we change the value of this variable and it changes automatically in all modules so this is modular continuity.
Here protection means security of our data. In this modern world we must ensure the security of our data. Her we must insure that we hide our personal data or information from general public . This data is only access able by the related people.
You can read more about software construction by reading Book. Click Here
So Now we discuss 5 rules For Modularity
All modules must contain an interface through which they are related to other modules. We cannot completely remove them. But we try to short the relation among the modules.
The maximum link that we can create are derived from the formula n(n-1)/2
It means that the connection capacity to communicate with one module to other module must be short. This thing decrease the complexity. As the percentage of communication among the modules decrease it makes everything simple.
It means the interface that we design must be clearly defined. So that it is easily understandable by the other peoples.
It refers to the term encapsulation. Means hide personal and important data from the unauthorized people. It is very important to secure data.