SlideServe
Menu
Préférences
© SlideServe · v2026

OO Principles

hilary-arnold avatar
4 diapositives · 368 Views · Nov 07, 2014

OO Principles. (Weak vs. Strong) Encapsulation( 封裝性 ): – Use setter/getter methods (+ private fields) (Tight vs. Loose) Coupling ( 耦合力 ): – 不同類別間認識的程度 ( 越低越好 => 避免干擾 ) (Low vs. High) Cohesion ( 內聚力 ): 某類別是否有單一明確的目標 ( 越明確,越易 reuse) 通常 higher cohesion <=> looser coupling. 020. AD.

OO Principles - slide 1
01 / 4OO Principles
1 / 17

Télécharger la présentation

OO Principles
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. OO Principles • (Weak vs. Strong) Encapsulation(封裝性): – Use setter/getter methods (+ private fields) • (Tight vs. Loose) Coupling (耦合力): – 不同類別間認識的程度(越低越好=> 避免干擾) • (Low vs. High) Cohesion (內聚力): • 某類別是否有單一明確的目標(越明確,越易reuse) 通常higher cohesion <=> looser coupling

  2. 020 AD 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

  3. 023 BC 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

  4. 087 E A team of programmers is involved in reviewing a proposed design for a new utility class, After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered? A. Tight coupling B. Low cohesion C. High cohesion D. Loose coupling E. Weak encapsulation F. Strong encapsulation