Base Entities Module

The Base Entities module serves as the foundation for the domain layer in the Macha Core, as defined by Clean Architecture principles. It encapsulates core business rules and enterprise-wide models that are critical for the functionality of the system. These entities ensure stability, scalability, and maintainability throughout the core while remaining independent of external systems such as frameworks, databases, or UI layers.

Introduction

The Base Entities module provides a set of abstract and reusable definitions for business objects that are designed to:

  • Encapsulate Business Rules: Representing the fundamental policies of the system that are least likely to change.
  • Enable Reuse: Promoting modularity and flexibility across the core.
  • Separate Concerns: Ensuring independence from external dependencies, allowing clean integration with infrastructure, UI, and databases.

These entities act as the Core Layer in the core and are essential for building scalable and maintainable systems aligned with Clean Architecture.

Dependency Graph

Dependency Graph

Class Diagram

Class Diagram

Features

  1. Enterprise-Wide Business Rules:

    • Provides foundational objects like identifiers, entities, and dynamic containers.
    • Ensures consistency and standardization across core-specific implementations.
  2. Independence:

    • Base entities remain independent from external frameworks, databases, and user interfaces.
    • Adheres strictly to the Dependency Rule of Clean Architecture.
  3. Modularity:

    • Promotes the modular design of core components, allowing extensions and customization without affecting the core models.
  4. Support for Extended Models:

    • Acts as the foundation for building client-specific entities and use cases by enabling extensions and abstraction.

Components

The Base Entities module includes the following components:

  • Identifiers:

    • Utilities like EntityId and AddressId, ensuring unique identification of entities using either UUID or key-based approaches.
  • Dynamic Entities:

    • Defines flexible containers such as DynamicEntity, allowing runtime custom attributes for supplementary, non-primary models.
  • Contact Entities:

    • Includes examples like Address, encapsulating fundamental attributes related to contact management.