第一题:
A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they
realize that they can reduce the number of methods in the API without losing any functionality. If they
implement the new design, which two OO principles will they be promoting?
A. Looser coupling
B. Tighter coupling
C. Lower cohesion
D. Higher cohesion
E. Weaker encapsulation
F. Stronger encapsulation
答案:AD

第二题:
A company has a business application that provides its users with many different reports: receivables reports,
payables reports, revenue projects, and so on. The company has just purchased some new, state-of-the-art,
wireless printers, and a programmer has been assigned the task of enhancing all of the reports to use not only
the company's old printers, but the new wireless printers as well.
When the programmer starts looking into the application, the programmer discovers that because of the
design of the application, it is necessary to make changes to each report to support the new printers.
Which two design concepts most likely explain the situation? (Choose two.)
A. Inheritance
B. Low cohesion
C. Tight coupling
D. High cohesion
E. Loose coupling
F. Object immutablility
答案:BC

第三题:
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

谁能来谈谈对这三题的看法呢?