Which is correct?
A.
Employee takes advantage of composition.
B.
Employee “has-an” Email.
C.
Employee “is-a” LetterPrinter.
D.
Employee has low cohesion.
Explanation:
The relationship between Employee and e-mail is poorly implemented here.
There is low cohesion.
Note:
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.Reference:Cohesion (computer science)
D