Skip to main content
PreparationZone Logo
PrepZone

Repository and Facade

Hide persistence and subsystem complexity behind narrow ports.

Pass checkpoint below

Why this matters

  • Repository port — detailed pointwise breakdown in the section below.
  • In-memory vs DB — detailed pointwise breakdown in the section below.
  • Facade over subsystems — detailed pointwise breakdown in the section below.
  • CampusOS library — detailed pointwise breakdown in the section below.
  • Patterns are forces and solutions — name the force before the pattern.
Dependency direction
Controller / FacadeHTTP or API entry
Serviceuse cases, orchestration
Domainentities, rules, invariants
Repositorypersistence port
Dependencies point inward — domain never imports infrastructure.

Overview

Hide persistence and subsystem complexity behind narrow ports. Study each section below in order — every list is interview-ready reference material.

Repository port

Points to cover

  • Definition — what Repository port means in one clear sentence
  • When to use — the force or smell that triggers this concept
  • CampusOS example — where this appears in parking, booking, or library modules
  • How to explain — pointwise bullets you can say aloud in an interview
  • Common mistake — what weak candidates do instead
  • Refactor move — one concrete change that improves the design

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 3 sections

  • In-memory vs DB
  • Facade over subsystems
  • CampusOS library

Test yourself

Answer these before moving on — recall is what makes it stick.