skills/smithery.ai/encapsulation

encapsulation

Installation
SKILL.md

Encapsulation

Overview

Hide internal state. Expose behavior, not data. Control access through methods.

Public fields let anyone modify your object's internals, bypassing validation and breaking invariants. Encapsulation protects data integrity.

When to Use

  • Designing classes with state
  • Tempted to make fields public
  • External code directly modifies object state
  • Invariants can be violated by direct access

The Iron Rule

Installs
1
First Seen
Mar 21, 2026
encapsulation from smithery.ai