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.
What design flaw is most likely the cause of there new bugs?
A. Inheritance
B. Tight coupling
C. Low cohesion
D. High cohesion
E. Loose coupling
F. Object immutablility
答案:B
解析:
工程師在修改時只需要針對功能做小部分的修改
這是高度的分工
不過當他正確的修改了程式以後
那些與這個片段相關的程式都無法正常運作了
這裡很可能就是資料交流中出現問題
程式之間的資料交流有太多多餘的部分
就很容易出現這種高度耦合問題
0 意見:
張貼留言