14 Nov 2023



Intermediate

The shared kernel should be:

  1. Domain-centric: Focused on core domain concepts and logic, it should avoid incorporating implementation details or infrastructure code.

    • Example 1: If the shared kernel is part of a healthcare system, it should focus on core healthcare concepts like patient management, medical records, and appointment scheduling, without delving into technical details such as database implementation.
    • Example 2: In an e-commerce platform, the shared kernel should center around essential business concepts like product catalog management, shopping cart functionality, and order processing, without including details about payment gateway integration.
  2. Domain-independent: The shared kernel must be agnostic to any specific domain, allowing its use across various domains in the system without requiring modification.

    • Example 1: A shared kernel for user authentication and authorization services can be designed to work seamlessly across various domains, such as finance, healthcare, or education, without being tied to specific business rules or workflows.
    • Example 2: A messaging service shared kernel can be domain-independent, providing core messaging functionality that can be integrated into different domains, such as social networking, customer support, or project collaboration.
  3. Reusable: Designed with reusability in mind, the shared kernel should be easily applicable across different domains.

    • Example 1: A shared kernel for handling date and time calculations can be reused in different modules or domains of a system, ensuring consistent and accurate time-related functionality.
    • Example 2: A logging and error-handling shared kernel, designed to capture and report errors, can be easily reused across various components of a software application.
  4. Extensible: The shared kernel should be extensible, enabling the addition of new functionality without disrupting existing code."

    • Example 1: A shared kernel for a content management system can be designed to allow easy integration of new content types or features without requiring a major overhaul of the existing codebase.
    • Example 2: An extensible notification service shared kernel can accommodate the addition of new notification channels (e.g., email, SMS, push notifications) without disrupting the existing notification framework.