Given :
A company that makes Computer Assisted Design (CAD) software has, within its application,some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to
be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly.
A. Inheritance
B. Tight coupling
C. Low cohesion
D. High cohesion
E. Loose coupling
F. Object immutability
Answer: B
Suppose there are two Classes, Class A and Class B .If the Class A depends or relies on the parts of Class B ,which are not exposed through the interface of Class B .Such Scenario between the Classes is Called as Tight coupling.
In the above question the new Algorithm is asked to be implemented on Class's API and all other Classes which depends or relies on Class's API got affected due to Tight coupling.Option B.
A company that makes Computer Assisted Design (CAD) software has, within its application,some utility classes that are used to perform 3D rendering tasks. The company's chief scientist has just improved the performance of one of the utility classes' key rendering algorithms, and has assigned a programmer to replace the old algorithm with the new algorithm. When the programmer begins researching the utility classes, she is happy to discover that the algorithm to
be replaced exists in only one class. The programmer reviews that class's API, and replaces the old algorithm with the new algorithm, being careful that her changes adhere strictly to the class's API. Once testing has begun, the programmer discovers that other classes that use the class she changed are no longer working properly.
A. Inheritance
B. Tight coupling
C. Low cohesion
D. High cohesion
E. Loose coupling
F. Object immutability
Answer: B
Explanation:
Definition of coupling:Degree to which one class knows about another class.When we are having loose coupling and tight coupling ?
Suppose there are two Classes, Class A and Class B .If the Class A depends or relies only on those parts of Class B ,which is exposed using the interface of Class B .Such Scenario between the Classes is Called as loose coupling.
In the above question the new Algorithm is asked to be implemented on Class's API and all other Classes which depends or relies on Class's API got affected due to Tight coupling.Option B.
0 comments:
Post a Comment