Free Online Flashcard Deck

9 Designing Object-Oriented Systems Free Online FlashCards

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

12 cards
01
Front

What does object-oriented design organize a system around?

Back

Object-oriented design organizes a system around objects, their responsibilities, and their collaborations. The goal is a system that is understandable, changeable, and testable.

02
Front

What is the difference between a class and an object?

Back

A class is a blueprint that defines data and operations for a kind of object. An object is a particular runtime instance with its own identity and state.

03
Front

What is encapsulation?

Back

Encapsulation combines state and behavior while controlling access to implementation details. It lets an object protect its invariants through meaningful operations.

04
Front

What is an invariant in object-oriented design?

Back

An invariant is a condition that must remain true for an object. Encapsulation protects it by preventing invalid state through ordinary operations.

05
Front

How should a responsibility be assigned to an object?

Back

Assign a responsibility to the object that has the needed information or should protect the related rule. This keeps behavior near relevant data and rules.

06
Front

What does high cohesion mean?

Back

High cohesion means an object’s responsibilities support one clear purpose. It makes classes easier to understand, maintain, and test.

07
Front

What does an interface define?

Back

An interface is a contract: a set of operations that an implementing class promises to provide, without specifying its implementation.

08
Front

Why should interfaces be focused?

Back

Interfaces should contain related operations that implementers actually need. Several small, coherent interfaces are usually easier to understand than one broad interface.

09
Front

When is inheritance appropriate?

Back

Inheritance is appropriate when a derived type is genuinely a kind of the base type and can honor its expectations. It should not be used only to reuse a few lines of code.

10
Front

What is substitutability in inheritance?

Back

A subtype is substitutable when code expecting the base type can safely use every proposed subtype without special-case checks.

11
Front

What does polymorphism allow?

Back

Polymorphism lets code use an abstraction while the actual object supplies the appropriate behavior at runtime. One contract can therefore support multiple implementations.

12
Front

What relationship does composition express?

Back

Composition builds an object from other objects it contains or uses. It expresses a “has-a” or “uses-a” relationship and often allows components to be replaced independently.