← Back to Webstore Course
Week 5: Commerce Framework and Provider Abstractions
Week 5 is the architecture pivot point. Students learn exactly why
some logic belongs in shared commerce contracts while other logic
belongs in provider packages.
Learning Objectives
- Understand shared hooks and provider-specific handlers.
- Place new behavior in the correct layer consistently.
- Avoid duplicate business logic across providers.
- Document layer decisions for future maintainers.
Detailed Topics
1. Shared Contract Design
A shared hook should define stable behavior and types, without
leaking provider-specific assumptions into app code.
2. Provider Adapter Responsibilities
Provider packages translate shared contracts into concrete API or SDK
calls, normalize responses, and isolate external differences.
3. Change Placement Decision Framework
Teach a repeatable decision method: ask whether logic is universal,
provider-specific, or purely app UX. This reduces architecture drift
over time.
Pair Session Plan (90 Minutes)
- Pick one cart or product behavior to extend.
- Update shared contract and one provider implementation.
- Verify app usage remains provider-agnostic.
- Review tradeoffs in a short design note.
Independent Ticket
Add one hook extension and submit a layer-decision document that
explains why each line of logic belongs where it was placed.
Mentor Checkpoint
- Student separates shared and provider logic correctly.
- Student preserves abstraction boundaries in review.
- Student communicates architecture reasoning clearly.
← Previous: Week 4
Next: Week 6 →