Free Online Flashcard Deck

8 Object-Oriented Design Free Online FlashCards

Study 8 Object-Oriented Design with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is the difference between a class and an object?

Back

A class defines shared structure and behavior; an object is a particular class instance with its own state.

02
Front

What does encapsulation protect?

Back

Encapsulation combines data with governing operations, restricts direct access to representation, and protects invariants through a meaningful public interface.

03
Front

When is inheritance appropriate?

Back

Inheritance is appropriate when a subtype genuinely satisfies the behavioral contract of its supertype; otherwise, its coupling and rigidity can outweigh reuse.

04
Front

How does polymorphism reduce conditional logic?

Back

Polymorphism lets code use an abstraction while the concrete object selects the implementation, reducing conditional logic and easing the addition of new implementations.

05
Front

What does an interface specify?

Back

An interface specifies a contract of operations without requiring a particular implementation, allowing different classes to provide the same capability independently.

06
Front

What is composition in object-oriented design?

Back

Composition builds a class from references to other objects, allowing behavior to be replaced at runtime and making testing with substitute objects easier.

07
Front

What is the information expert guideline?

Back

The information expert guideline assigns behavior to the object that has the information needed to perform it. For example, an Order should usually calculate its own total.

08
Front

What is pure fabrication?

Back

Pure fabrication creates a focused service that is not a domain entity when doing so improves cohesion and reduces coupling, such as an InvoicePrinter.

09
Front

What does high cohesion indicate?

Back

Cohesion measures how closely a module’s responsibilities belong together. High cohesion gives a class a focused purpose and makes it easier to understand, test, reuse, and change.

10
Front

Why should coupling be limited?

Back

Coupling measures how strongly modules depend on one another. Low, intentional coupling limits ripple effects by using stable abstractions, necessary information, and hidden implementation details.

11
Front

What does the Single Responsibility Principle require?

Back

The Single Responsibility Principle says a class should have one coherent responsibility and one primary reason to change; it does not require the class to contain only one method.

12
Front

What is the Open–Closed Principle?

Back

The Open–Closed Principle says software entities should be open for extension but closed for modification, often by placing variation behind an abstraction such as ShippingStrategy.