HakiDocs
Java

Encapsulation

Basic programming paradigm

Core Concept

Object-Oriented Programming (OOP) is a programming paradigm in computer science that relies on the concept of classes and objects. It is used to structure a software program into simple, reusable pieces of code blueprints (usually called classes), which are used to create individual instances of objects.

All components of an application
are converted into objects.

Each object has its own responsibility.
This allows us to easily apply
the principles of Single Responsibility Principle,
Separation of Concerns SoC or The Law of Demeter.

Benefits of OOP for software engineering

  • OOP models complex things as reproducible, simple structures
  • Reusable, OOP objects can be used across programs
  • polymorphism allows for class-specific behavior
  • Easier to debug, classes often contain all applicable information to them
  • Securely protects sensitive information through Encapsulation

Resources