How sampathreddy22/examplars works
Examplars is a runnable collection of Python design-pattern examples; the documented current pattern is a money-transfer Saga. A user selects a pattern through the CLI, which dispatches to the demo: it resets and seeds the database, starts transfers, and displays balances and saga logs. The orchestrator persists saga progress, runs validation, debit, credit, and audit steps, and compensates completed steps in reverse after failure. The README describes adding more patterns, but only Saga is present in the tree. The graph reflects sampled source and README evidence; it does not imply external distributed services.
Main entry points: orchestrator.py Saga orchestrator · db.py SQLite saga database · main.py Transfer demo · cli.py Pattern dispatcher
Components 9
Pattern entry
- Pattern dispatcher
patterns/cli.py
Transfer saga
- Transfer demo
patterns/saga/main.py - Saga orchestrator
patterns/saga/orchestrator.py - Validate transfer
patterns/saga/steps.py - Debit source
patterns/saga/steps.py - Credit destination
patterns/saga/steps.py - Record transfer
patterns/saga/steps.py
Saga state
- SQLite saga database
patterns/saga/db.py
Other components
- CLI user
Connections 13
- CLI user → Pattern dispatcher: selects pattern
patterns/cli.py - Pattern dispatcher → Transfer demo: dispatches to
patterns/cli.py - Transfer demo → Saga orchestrator: starts transfers
patterns/saga/main.py - Transfer demo → SQLite saga database: resets, seeds, reads
patterns/saga/main.py - Saga orchestrator → SQLite saga database: persists saga state
patterns/saga/orchestrator.py - Saga orchestrator → Validate transfer: runs, compensates
patterns/saga/orchestrator.py - Saga orchestrator → Debit source: runs, compensates
patterns/saga/orchestrator.py - Saga orchestrator → Credit destination: runs, compensates
patterns/saga/orchestrator.py - Saga orchestrator → Record transfer: runs, compensates
patterns/saga/orchestrator.py - Validate transfer → SQLite saga database: reads accounts
patterns/saga/steps.py - Debit source → SQLite saga database: updates accounts
patterns/saga/steps.py - Credit destination → SQLite saga database: updates accounts
patterns/saga/steps.py - Record transfer → SQLite saga database: writes transfer log
patterns/saga/steps.py