Free Online Flashcard Deck

8 Object-Oriented Design Principles Free Online FlashCards

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

12 cards
01
Front

What distinguishes a class from an object?

Back

A class is a blueprint defining shared data and operations; an object is a particular runtime instance of that class.

02
Front

What three characteristics commonly define an object?

Back

An object combines state, behavior, and identity. State is its data, behavior is what it can do, and identity distinguishes it from other objects.

03
Front

How does encapsulation protect an object?

Back

Encapsulation combines state with behavior and controls access to the representation, allowing the object to protect its invariants.

04
Front

When is inheritance a sound design choice?

Back

Inheritance is appropriate when a subclass genuinely satisfies the parent type’s behavioral contract, not merely when it can reuse a few methods.

05
Front

What does polymorphism allow?

Back

Polymorphism lets code use a common type while the actual object supplies the implementation that runs.

06
Front

What does an interface provide?

Back

An interface defines a contract or capability without requiring clients to know its implementation.

07
Front

What is composition in object-oriented design?

Back

Composition constructs an object from collaborators that perform parts of its work, allowing behavior to vary by supplying different collaborators.

08
Front

What does the Information Expert principle prescribe?

Back

The Information Expert principle assigns an operation to the object that has the information needed to perform it.

09
Front

Which class should usually create an object?

Back

The Creator rule assigns creation to a class that closely uses, aggregates, contains, or records the object being created.

10
Front

What does cohesion measure?

Back

Cohesion measures how closely a class’s responsibilities belong together. High cohesion means the class has a focused, meaningful purpose.

11
Front

What does coupling measure?

Back

Coupling measures how strongly one class or module depends on others. Good design aims for few, stable, explicit dependencies on suitable abstractions.

12
Front

What is dependency injection?

Back

Dependency injection supplies collaborators from outside an object instead of having the object construct them internally.