Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Software Architecture - Coupling and Cohesion
Message
 
À
29/04/2004 11:23:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00899040
Message ID:
00899388
Vues:
19
>>>Obviously, I'm not Nancy.
>Weeell, I guess you'll do. <g>
>
>>> There are several different kinds of cohesion. Functional cohesion means that the module performs one and only one operation to have functional cohesion. This does not mean only one line of code, but rather one purpose.
>
>I'm only familiar with Functional cohesion but I read your post last night, thanks for the info. I still believe there is the question of what the term cohesion mean. At the link Mike provided ( http://c2.com/cgi/wiki?CouplingAndCohesion ) gives three quick explanations of cohesion.
>
>1 - Cohesion is the degree to which the responsibilities of a single component form a meaningful unit.
>2 - Cohesion is a property or characteristic of an individual module
>3 - Cohesion : qualitative measure of dependency of items within a module (from worse to better, high cohesion is good)
>

>The first of these three quick descriptions is what I've always understood what cohesion meant. If I'm understanding this correctly then with the other kinds of cohesion they would have levels of meaning as well, I think?
>
>Another way to look at the other kinds of cohesion, break down the description it self. Functional Cohesion, Communicational Cohesion, Logical Cohesion (and the others that all end with 'al') doesn’t the first word in all of the kinds of cohesion describe a situation? Surely the word Cohesion means the same thing in all the different kinds of cohesion. But then again, maybe not
>
>I don't know what are your thoughts.

For example, coincidental cohesion occurs when the operations in a routine have no relationship with each other. Logical cohesion occurs when the same routine does two different things, which one is based on a logical parameter. Both of these are bad. An exception to this, however, is something like a message handler that only has the purpose of routing the message properly.

Striving for functional cohesion is best. If you wrap say a reporting handler, that simply serves to call individually functionally cohesive routines, this can be said to have a high degree of cohesion, even if the handler has to do things in a specific order. It can be said that it demonstrates high functional cohesion. Technically, it probably could be called sequential cohesion, but really I wouldn't.

One rule of thumb that I have is this: If you can accurately describe exactly what a routine does, without a conjunction, in a single sentence, the routine probably exhibits high cohesion.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform