2009年2月5日 星期四

第24題

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
參考:第6 章物件導向基本觀念

有間公司寫了一個CAD的軟體,想要更新一些功能,就請一位工程師去看程式碼看需修改什麼,工程師看後發現只需修改其中的一個class的演算法就可以了,當工程師修改後進行測試時發現所有的功能都無法運作,何者的系統設計的序述較符合這bug的情況?
B. Tight coupling //高相依性

沒有留言:

張貼留言