nerdexam
Oracle

1Z0-804 · Question #104

Give: Which is correct?

The correct answer is D. Employee has low cohesion. The relationship between Employee and e-mail is poorly implemented here. There is low cohesion. Low cohesion is associated with undesirable traits such as being difficult to maintain, difficult to test, difficult toreuse, and even difficult to understand. Cohesion is decreased…

Object-Oriented Design Principles

Question

Give:

Which is correct?

Exhibit

1Z0-804 question #104 exhibit

Options

  • AEmployee takes advantage of composition.
  • BEmployee "has-an" Email.
  • CEmployee "is-a" LetterPrinter.
  • DEmployee has low cohesion.

How the community answered

(29 responses)
  • A
    7% (2)
  • B
    17% (5)
  • C
    3% (1)
  • D
    72% (21)

Explanation

The relationship between Employee and e-mail is poorly implemented here. There is low cohesion. Low cohesion is associated with undesirable traits such as being difficult to maintain, difficult to test, difficult toreuse, and even difficult to understand. Cohesion is decreased if: The functionalities embedded in a class, accessed through its methods, have little in common. Methods carryout many varied activities, often using coarsely-grained or unrelated sets of data. Disadvantages of lowcohesion (or"weak cohesion") are: Increased difficulty in understanding modules. Increased difficulty in maintaining a system, because logical changes in the domain affect multiple modules,and because changes in one module require changes in related modules. Increased difficulty in reusing amodule because most applications won't need the random set of operations provided by a module.

Topics

#cohesion#composition#has-a relationship#OO design

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice