CSC/ECE 517 Fall 2009/wiki3 18 301: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:
----
----


The instability of any package can be calculated using the following formula.
The ''instability'' of any package can be calculated using the following formula:


I (instability) = Ce / ( Ca + Ce )
'''I (instability) = Ce / ( Ca + Ce )'''


In this formula:
In this formula:


Ce – the number of other modules that our package requires to operate. In other words, this is an indicator of package independence.
Ce – the number of other modules that our package requires to operate. In other words, this is an indicator of package ''independence''.


Ca – the number of packages that can be viewed as “dependents“, i.e., “depend upon classes within the package”. This is an indicator of package responsibilities.
Ca – the number of packages that can be viewed as “dependents“, i.e., “depend upon classes within the package”. This is an indicator of package ''responsibility''.


Therefore, in order for a package to be completely independent and also stable, it should not be dependent upon other packages.
Therefore, in order for a package to be completely ''independent'' and also ''stable'', it should not be dependent upon other packages.


Using the formula: I = 0 / ( Ca + 0 ) = 0, has the instability of zero.
Using the formula: '''I = 0 / ( Ca + 0 ) = 0''', has the instability of zero.


Respectively, instable or irresponsible packages would have instability of 1 as shown below:
Respectively, ''instable'' or ''irresponsible'' packages would have instability of 1 as shown below:


I = Ce / ( 0 + Ce ) = Ce / Ce = 1
'''I = Ce / ( 0 + Ce ) = Ce / Ce = 1'''

Revision as of 03:23, 18 November 2009

Topic: Stable Dependencies Principle


The instability of any package can be calculated using the following formula:

I (instability) = Ce / ( Ca + Ce )

In this formula:

Ce – the number of other modules that our package requires to operate. In other words, this is an indicator of package independence.

Ca – the number of packages that can be viewed as “dependents“, i.e., “depend upon classes within the package”. This is an indicator of package responsibility.

Therefore, in order for a package to be completely independent and also stable, it should not be dependent upon other packages.

Using the formula: I = 0 / ( Ca + 0 ) = 0, has the instability of zero.

Respectively, instable or irresponsible packages would have instability of 1 as shown below:

I = Ce / ( 0 + Ce ) = Ce / Ce = 1