Apps Interactor

Software architecture is equal parts modularity and adaptability. Core Projects provide the reusable foundation for application behavior, encapsulating Interactors—the central drivers of use case logic. Interactors define how an application processes workflows, ensuring that the system executes consistent, clean, and testable behaviors.

But different applications require variations—specific adjustments to workflows that Core logic alone cannot address directly. This is the purpose of Apps Interactors.

Project structure

What is Apps Interactors?

Apps Interactors is a project within the Macha Applications layer. It serves to collect and manage customizations of Core Interactors, adapting shared workflows for application-specific requirements.

Apps Interactors allows developers to:

  • Extend and modify Core Interactors to align with specific business needs.
  • Tailor workflow logic, introducing application-level adjustments while preserving modularity.
  • Ensure Core workflows remain generic and reusable across multiple applications, while customizations are neatly organized in their own layer.

Purpose of Apps Interactors

1. Customizing Workflow Behavior

The Core Interactors provide generic implementations of use case logic, but Apps Interactors allows developers to adjust these workflows for specific applications.

For example:

  • A simple workflow like “Create Order” may need customization for payment approval policies or inventory checks in one application, while remaining generic for others.
  • “Process Shipment” might call for custom delivery logic based on priority levels or integrated tracking mechanisms.

2. Adding Business-Specific Rules

Each application introduces unique business rules. Apps Interactors bridges these rules with Core logic by extending or overriding workflow logic, enabling flexibility while keeping Core reusable.

3. Protecting Core Modularity

Rather than embedding application-specific details directly into Core workflows, Apps Interactors isolates custom logic, respecting Clean Architecture principles and keeping shared components generic and reusable.

How Apps Interactors Works

1. Inherit Core Interactors

Apps Interactors begins by pulling in the foundational workflows defined in Core Projects (via Interactors). These provide generic implementations of use case logic that can be extended or customized.

2. Apply Customizations

Interactors in Apps Interactors are tailored to meet application-specific demands:

  • Add Steps to Workflows: Extend existing workflows by introducing additional rules or sub-processes.
  • Override Logic: Modify existing workflows for application-level scenarios.
  • Adapt Framework Integrations: Customize Interactors to fit specific tools or infrastructure used in the application.

3. Prepare for Integration

Once customized, these Interactors flow into the Applications layer, which prepares them for use alongside Core components and eventual deployment through MachaOn Projects.

Examples of Core Interactor Customization

E-Commerce Example: “Create Order” Workflow

  • Core Workflow: Defines steps for creating an order—checking inventory, verifying customer details, and generating order confirmation.
  • Apps Interactor Customization: Adds payment approval logic, regional discount calculation, or promotional offer validation.

Logistics Example: “Process Shipment” Workflow

  • Core Workflow: Handles shipment tracking and route optimization.
  • Apps Interactor Customization: Adds priority handling for express shipments or integrates with third-party delivery APIs.

Finance Example: “Generate Invoice” Workflow

  • Core Workflow: Creates invoices based on customer data and transaction amounts.
  • Apps Interactor Customization: Adds late fee rules, tax calculations, or special payment terms for contractual clients.

Principles Behind Apps Interactors

1. Separation of Concerns

Apps Interactors respects Clean Architecture’s boundaries by isolating application-specific workflow adjustments from Core shared logic, keeping workflows generic and reusable in the Core layer.

2. Modular Customization

Custom behavior is neatly organized within Apps Interactors, ensuring changes are scoped to specific applications without polluting shared use cases.

3. Scalability

Interactors maintain modularity even when adjusted, allowing workflows to adapt alongside growing business requirements while preserving architectural integrity.

Why Apps Interactors Matters

Core Interactors drive workflow consistency and reusability, but real-world applications often introduce specific requirements. Without structured customization layers like Apps Interactors, developers risk breaking modularity by embedding workflow changes directly into Core logic.

Apps Interactors solves this problem by providing:

  • Customizable workflow logic scoped to applications.
  • Generic use case integrity for Core components.
  • A clean path for adapting workflows without compromising the reusable architecture of Machanism.

By isolating customizations in Apps Interactors, developers can align workflows with diverse application needs while preserving modularity across the ecosystem.

Apps Interactors and Macha Applications

As part of Macha Applications, Apps Interactors works alongside other projects to adapt Core logic for deployment. It ensures:

  • Workflow adjustments integrate seamlessly with Applications and MachaOn projects.
  • Interactors remain clean and organized, supporting separation of concerns.

By bridging Core workflows with customized application logic, Apps Interactors helps deliver scalable functionality tailored to real-world scenarios.

In Summary

Apps Interactors is where Core workflows become adaptable for specific applications. By collecting and customizing Interactors, this project allows developers to tweak and tailor shared logic without sacrificing modularity or reusability.

This structured approach ensures workflows remain scalable, adaptable, and aligned with Clean Architecture principles.