Catalog
concept#Software Engineering#Architecture#Delivery#Reliability

Object-Oriented Programming (OOP)

A programming paradigm modeling software as interacting objects with state and behavior. Promotes modularity, reuse, and information encapsulation.

Object-oriented programming is a foundational paradigm that organizes systems as collections of objects with attributes and methods.
Established
Medium

Classification

  • Medium
  • Technical
  • Architectural
  • Intermediate

Technical context

Testing frameworks (JUnit, pytest)Build tools and dependency managementDocumentation and modeling tools

Principles & goals

Encapsulation: hide internal implementationSingle Responsibility: classes have single responsibilitiesProgram to interfaces, not implementations
Build
Team, Domain, Enterprise

Use cases & scenarios

Compromises

  • Incorrect domain modeling leads to hard-to-maintain code
  • Overly complex hierarchies increase cognitive load
  • Misuse of inheritance over composition causes bottlenecks
  • Prefer composition over inheritance
  • Small, focused classes with clear responsibility
  • Program to interfaces and use abstractions

I/O & resources

  • Domain requirements and use cases
  • Existing architecture and interface descriptions
  • Team experience with OOP principles
  • Class diagrams and API specifications
  • Modular, reusable components
  • Test coverage for classes and interfaces

Description

Object-oriented programming is a foundational paradigm that organizes systems as collections of objects with attributes and methods. It uses concepts like classes, encapsulation, inheritance, and polymorphism to reduce complexity and increase reuse. OOP shapes design and architectural choices across many programming languages.

  • Improved modularity and code reuse
  • Better abstraction of complex domains
  • Easier testability and maintainability through clear boundaries

  • Can lead to excessive layering and boilerplate
  • Not always optimal for very simple or data-oriented tasks
  • Inheritance can create rigid coupling and fragility

  • Cohesion

    Measure of how related the methods and data are within a class.

  • Coupling

    Measure of dependencies between classes or modules.

  • Number of public methods per class

    An indicator of responsibility scope and surface area of a class.

Bank account class model

A typical example with account, customer and transaction classes demonstrating encapsulation and inheritance.

GUI components with inheritance

Base class for UI components and specialized widgets that encapsulate rendering and event handling.

CMS platform plugin system

Plugins implement defined interfaces, are loaded and operated via a common API.

1

Analyze domain and identify core concepts

2

Define interfaces and class responsibilities

3

Implement, test and refactor iteratively

⚠️ Technical debt & bottlenecks

  • Outdated inheritance structures making refactoring hard
  • Unclear ownership of classes and responsibilities
  • Missing tests for critical classes
Tight couplingDeep inheritance treesMissing interface definition
  • Using inheritance for reuse instead of extraction
  • Creating many tiny, unnecessary classes without clear benefit
  • Public mutable fields instead of controlled access methods
  • Excessive abstraction hides simple bugs
  • Undefined interfaces lead to implicit dependencies
  • Refactoring without tests endangers behavior
Understanding of classes, objects and design principlesAbility for abstract design and modelingExperience with testing and refactoring
Component reusabilityEncapsulation of state managementExtensibility and modularity
  • Language limitations and runtime costs
  • Compatibility requirements with existing APIs
  • Team skills in OOP design principles