Apps Entities
In modern software design, entities represent the foundation of business logic. These are the conceptual objects—like Orders, Products, or Users—that encapsulate the rules, behaviors, and data that define the system. In Machanism, Core Projects provide generic, reusable entities that are shared across multiple applications. But not every application is the same, and sometimes, customization is essential to meet specific business requirements.
This is the role of the Apps Entities project.
Project structure
What is Apps Entities?
Apps Entities is a project within Macha Applications. Its sole purpose is to collect and manage customizations of Core Entities. By tailoring shared entities provided by the Core layer, Apps Entities adapts them to meet the specific needs of an application, while still respecting the boundaries established by Clean Architecture.
Purpose of Apps Entities
-
Tailoring Core Entities for Specific Use Cases
- While Core Projects define generic entities, Apps Entities allows you to extend or override these entities for application-specific scenarios.
- For example, the Core might define a “Product” entity with basic attributes like
ID
,Name
, andPrice
. In Apps Entities, you might customize it to include attributes likeRegion
orTaxRate
if required by the application.
-
Seamless Integration into Applications and MachaOn
- Apps Entities ensures that entity definitions are aligned with the specific workflows of an Application Project while remaining compatible with the deployment needs of MachaOn.
-
Core Independence with Customization
- Apps Entities isolates all modifications outside of Core, ensuring that shared, reusable components remain untouched and adaptable for other projects.
How Apps Entities Works
-
Inherits Base Core Entities
Apps Entities starts by pulling in generic entities from the Core layer. These entities contain the foundational logic and attributes that make them reusable across multiple systems. -
Extends and Customizes
Using clear and isolated rules, Apps Entities applies customizations that align entities with the application’s unique requirements:- Add Attributes: Introduce new fields to extend the functionality of the entity.
- Override Logic: Custom behaviors and methods can be defined for application-specific use cases.
- Regional or Business-Specific Adjustments: Adapt entities to handle differences in laws, rules, or infrastructure.
-
Prepares for Integration in Applications
Once customized, the tailored entities flow into the Applications layer for further workflow implementation and eventual deployment in MachaOn.
Principles Behind Apps Entities
The Apps Entities project adheres to the architectural principles of Machanism to ensure scalability and maintainability:
-
Respect Core Independence
Core entities remain reusable and consistent across projects. Customizations are kept within Apps Entities, protecting the integrity of the Core layer and preventing contamination of shared logic. -
Customizations Are Isolated
The adaptations made in Apps Entities are application-specific. This ensures that changes are scoped and prevent unnecessary dependencies between unrelated applications. -
Modular and Scalable Design
Apps Entities is designed to grow alongside the system, adapting Core logic for new requirements without breaking the clean modularity of the Machanism ecosystem.
Why Apps Entities Matters
Successful software projects strike a balance between generic reusability and project-specific customizability. Core entities provide the foundation, but without a structured way to adapt them for real-world use cases, applications would either sacrifice modularity or end up reinventing the wheel.
Apps Entities ensures that:
- Core modules remain reusable.
- Customizations are modular and scoped.
- Entities are tailored to real-world application needs.
By managing entity adaptations in a clear, modular project, Apps Entities helps maintain the boundaries necessary for long-term scalability.
In Summary
Apps Entities is where Core meets customization. By extending and adapting shared entities, this project prepares the groundwork for applications that are both reusable and tailored to specific requirements.
With Apps Entities, you ensure that each entity supports the demands of the application while preserving the clean architectural principles that define Machanism.