Tuesday, April 2, 2013

Chapter 10 - cohesion

Identify one of the seven types of cohesion and explain why it would be considered one of “good” cohesion or one of “bad” cohesion.

9 comments:

  1. One of the seven types of cohesion is 'Communicational' which is explained in the book as activities that are using the same inputs and outputs for a function. The example the book, found on page 387, talks about is "Calculate Current and Cumulative GPA – Two tasks are performed because they both use the student grade record as input." I feel that this could be considered as one of ‘good’ cohesion. The reason that I decided this is it will pull the same information (inputs and outputs) in order to perform two functions rather than performing each function separately. This can save time, create a sense of convince, and could be seen as simplifying the process for users.

    ReplyDelete
  2. "Functional" cohesion is a module that performs one problem-related task. This could be "calculate current g.p.a" or "look up classes." This is considered a good type of cohesion because it follows well with the lines of code, it also follows the rules of a good module which is that it should only perform one task.

    ReplyDelete
  3. Another type of cohesion is sequential. During sequential cohesion, the output from one task is used by the next task. When looking at a student's GPA, formatting the GPA is the first task that is the input for the second task of validating one's GPA. This is considered a "good" cohesion mainly because of its high importance with code and program design.

    ReplyDelete
  4. Coincidental is another type of cohesion. Coincidental cohesion incorporates a number of non-related tasks that have no apparent relationship. This kind of cohesion is the poorest since this module performs different functions that have nothing to do with each other such as updating customer records, calculating loan payments, printing reports, or analyzing competitor pricing structure.

    ReplyDelete
  5. Temporal is another form of cohesion is when functions within a module do not have much in common except in that of being invoked at the same time. In other words each occur at the same time however are unrelated from each other, which is the main reason that temporal cohesion leans more towards the poorer side of the cohesion scales.

    ReplyDelete
  6. Logical is also another form of cohesion where its a lists of activities depending on the message within the module, these activities are related or similar in one or more respects. For example they perform similar functions, follow the same protocol, opening a checking account, open a savings account, or calculate a loan.

    ReplyDelete
  7. Procedural is another form of cohesion when the elements are performed in sequence by the elements do not share data. The module includes the following: housekeeping, produce report off of print grade and listing.

    ReplyDelete
  8. The main reason that Functional Cohesion is better than Coincidental is because all elements of the module contribute to performing a single task requiring high levels of cohesion. On the other hand coincidental cohesion is where no elements relate or appear to have any relationships among functions.

    ReplyDelete
  9. Functional cohesion is considered a good cohesion because it's task is to perform one thing. It will solve a problem such as calculating a GPA. Since it only performs one task it is considered good cohesion.

    ReplyDelete