Architectural Patterns are high-level structural approaches for organizing entire applications or major subsystems. Unlike design patterns which focus on specific code-level solutions, architectural patterns shape the overall structure of software systems.
Functional Core, Imperative Shell
A pattern that separates pure functional logic (the core) from side effects and I/O operations (the shell). The core contains business logic with no side effects, while the shell handles all interactions with the outside world.
Benefits:
- Easier testing of business logic
- Clear separation of concerns
- Better reasoning about code behavior
- Reduced complexity in core logic
Resources:
- Boundaries - Gary Bernhardt’s foundational talk
- Functional Core, Imperative Shell
- Favor real dependencies for unit testing
- Impureim sandwich - Mark Seemann’s variation
- Asynchronous Injection
Related:
- Monads - Managing side effects in functional programming
- Command Query Separation - Related principle about separating commands from queries
Related Concepts
- Design Patterns - Code-level structural patterns
- Design Principles - Guidelines for structuring code
- System Architecture - Broader architectural topics
- Good Software Practices