CompTIA Tech+ (FC0-U71)Software Development ConceptsHard

A software architect is designing a system where different components need to interact by sending messages to each other. However, the internal implementation details of each component should be hidden from other components, and they should only be exposed to a well-defined interface. This allows changes to a component's internal workings without affecting others. Which Object-Oriented Programming (OOP) principle is being applied here?

  1. AAbstraction
  2. BPolymorphism
  3. CEncapsulation
  4. DInheritance
Show answer & explanation

Correct answer: A. Abstraction

Abstraction focuses on showing only essential information and hiding complex implementation details. By defining a clear interface and hiding internal workings, components interact at a high level without needing to know the specifics, aligning with the principle of abstraction.

Why the other options are wrong

  • B. Polymorphism allows objects of different classes to be treated as objects of a common type.
  • C. Encapsulation bundles data and methods into a single unit and restricts direct access to some of its components, often achieved through abstraction.
  • D. Inheritance is about creating new classes from existing ones, inheriting properties and behaviors.

Abstraction (OOP)

An OOP principle that involves hiding the complex implementation details of a system or component and only showing the essential features or relevant information to the user or other components. It focuses on 'what' an object does rather than 'how' it does it.

  • Reduces complexity by allowing developers to focus on high-level design.
  • Achieved through abstract classes, interfaces, and well-designed APIs.
  • Promotes modularity and easier maintenance.
  • Often works hand-in-hand with encapsulation.

Memory trick: Abstraction: Abstract away the messy details, show only the facade.

More Software Development Concepts questions