Skip to main content

Core Principles of Prism Architecture

Reading time: ~8 minutes

Introduction​

Prism Architecture is built upon fundamental principles that guide its design and implementation. These principles emerged from practical experience with the limitations of traditional architectures when applied to modern application development challenges. Understanding these core principles provides essential context for working with Prism Architecture effectively.

Balance of Separation and Integration​

At the heart of Prism Architecture is a careful balance between separation of concerns and practical integration of components.

Practical Separation of Concerns​

Prism Architecture maintains clear boundaries between different aspects of an application, but does so pragmatically:

  • Defined Layer Responsibilities: Each layer has specific, well-defined responsibilities
  • Clear Communication Patterns: Standardized methods for layers to interact
  • Appropriate Abstractions: Abstractions that add value rather than complexity
  • Practical Boundaries: Layer boundaries that enhance rather than hinder development

Unlike more rigid architectures that enforce strict isolation, Prism Architecture acknowledges that some controlled connections between layers can improve efficiency without sacrificing architectural integrity.

Accessible Core Domain Models​

A distinguishing characteristic of Prism Architecture is how it handles domain models:

  • Shared Core Layer: Core domain models reside in a layer accessible to all other layers
  • Reduced Transformation Overhead: Minimizes the need for constant model mapping between layers
  • Consistent Domain Language: Ensures all parts of the application speak the same domain language
  • Domain Integrity: Maintains strong typing and domain rules while enabling practical access

This approach differs significantly from traditional Domain-Driven Design, where models are typically isolated within bounded contexts and require explicit translation between contexts.

Intent-Based Communication​

Prism Architecture employs an intent-based communication model to create a clear, traceable flow of information through the system.

Alternatively, we could represent the same concept as a flowchart with direction:

Declarative Action Communication​

  • Intent Objects: Actions and requests are represented as explicit intent objects
  • Clear Purpose: Each intent has a clear, single purpose
  • Enhanced Traceability: Explicit intents make the flow of operations easier to trace and debug
  • Reduced Coupling: Components depend on intent interfaces rather than direct method calls

This pattern creates a more declarative style of programming where components express what they want to happen rather than how it should happen.

Bidirectional Event Flow​

Prism Architecture recognizes that events need to flow both up and down the architecture:

  • Domain-Originating Events: Important changes originate in the Domain Layer
  • Orchestrated Responses: The Orchestration Layer coordinates reactions to domain events
  • UI Notifications: Events propagate to the Presentation Layer for UI updates
  • Technical Distribution: The Infrastructure Layer handles the mechanics of event distribution

This bidirectional flow enables reactive programming patterns throughout the architecture.

Hierarchical Organization​

Prism Architecture organizes components hierarchically to manage complexity at all levels.

Component Hierarchy​

  • Layered Architecture: The primary organization is into distinct layers
  • Sub-Layer Organization: Within layers, components are organized by complexity and scope
  • Feature Alignment: Components typically align with business features or domains
  • Dependency Management: Higher-level components depend on lower-level ones, not vice versa

This hierarchical approach applies within individual layers as well. For example, in the Presentation Layer, presenters are organized hierarchically from screen level down to component level.

Orchestration Hierarchy​

A particularly important hierarchy exists in the Orchestration Layer:

  • Use Cases: Handle simple entity-focused operations
  • Orchestration Services: Manage feature-area operations that span multiple use cases
  • Workflow Coordinators: Coordinate complex cross-domain processes
  • Clear Escalation Path: Simpler components delegate to more complex ones as needed

This hierarchy ensures that each orchestration component has an appropriate scope and complexity.

Adaptability to Modern Patterns​

Prism Architecture is designed to work well with modern development approaches.

GraphQL Optimization​

Unlike architectures designed primarily for REST APIs, Prism Architecture acknowledges the different data access patterns needed for GraphQL:

  • Query Optimization: Special patterns for efficient data retrieval across aggregate boundaries
  • Batch Loading: Support for optimized loading of related entities
  • Schema Alignment: Domain models that naturally align with GraphQL schema structures
  • Maintained Integrity: Domain rules enforced while still enabling optimized queries

Declarative UI Support​

Prism Architecture integrates well with modern declarative UI frameworks:

  • State-Based Rendering: The architecture supports the state-driven approach of modern UI frameworks
  • Unidirectional Data Flow: State flows down the component hierarchy
  • Intent-Based Interactions: User actions flow up as intents
  • Clean UI Logic: Presentation logic separated from business logic

Pragmatic Implementation​

Prism Architecture values practical implementation over dogmatic adherence to architectural rules.

Layer Autonomy​

  • Internal Structure Freedom: Each layer has freedom over its internal structure
  • Pattern Appropriateness: Different patterns can be used where they make the most sense
  • Team Ownership: Teams can own layers and determine their internal organization
  • Adaptation to Context: Implementation details can adapt to the specific platform or framework

Scalable Complexity​

Prism Architecture scales to different application sizes and complexity levels:

  • Prism Architecture Lite: Simplified version for smaller applications
  • Standard Prism Architecture: For medium to large applications
  • Extended Prism Architecture: Adds optional layers for enterprise applications
  • Progressive Adoption: Can be adopted incrementally in existing applications

Key Benefits of These Principles​

The core principles of Prism Architecture yield significant benefits:

  1. Reduced Conceptual Overhead: Developers can focus on one aspect of the system at a time
  2. Enhanced Maintainability: Clear separation makes long-term maintenance easier
  3. Better Testing Isolation: Components can be tested independently
  4. Flexibility with Structure: Provides structure without unnecessary rigidity
  5. Improved Communication: Teams have a shared understanding of the system organization
  6. Adaptability: Works well with a variety of platforms, frameworks, and UI approaches

Contrasting with Other Architectures​

To understand Prism Architecture's principles more deeply, consider how they differ from other common architectures:

Compared to Domain-Driven Design​

  • Prism: Uses accessible core domain models with shared access
  • DDD: Isolates models within bounded contexts with explicit translation

Compared to Clean Architecture​

  • Prism: Core layer accessible by all, other communications flow through Orchestration
  • Clean: Strict dependency rule where inner layers are unaware of outer layers

Compared to Onion Architecture​

  • Prism: Orchestration Layer actively coordinates between layers
  • Onion: Application layer serves primarily as a boundary between domains and infrastructure

Conclusion​

The core principles of Prism Architecture provide a foundation for building applications that are both well-structured and practical to implement. By balancing separation of concerns with practical integration, organizing components hierarchically, and adapting to modern development patterns, Prism Architecture offers a valuable approach for contemporary software development challenges.