Core Concepts of ONDEMANDENV

ONDEMANDENV introduces several core concepts designed to bring order, consistency, and agility to the management of complex distributed systems. Understanding these concepts is key to leveraging the platform's power. For a deeper technical overview, see the ONDEMANDENV Architecture Deep Dive article.

Note on Implementation: While the current examples and reference implementation heavily utilize AWS CDK and CloudFormation for defining and deploying resources, the core ONDEMANDENV principles – Application-Centricity, Envers, contractsLib, Cloning, and Platform Abstraction – are tool-agnostic. The same conceptual framework could be implemented using other Infrastructure-as-Code tools like Terraform CDK, Pulumi, or potentially even primarily with cdk8s for environments heavily focused on Kubernetes orchestration. The key is the pattern of codified contracts, versioned environments, and platform automation.

Application-Centric Infrastructure

Instead of viewing infrastructure and applications as separate entities managed by different tools (like CloudFormation for infra, Kubernetes/Helm for runtime), ONDEMANDENV adopts an Application-Centric approach.

Crucially, the scope defined by an Application-Centric approach (and therefore the scope of a BuildDefinition and its Envers) is subjective and user-determined, guided by Domain-Driven Design principles. It can range from a single deployable artifact like a container image or shared library package, to a specific frontend deployment, a full-stack vertical slice, or even complex platform infrastructure like a dedicated EKS cluster Enver.

AI-Assisted Development Benefits: This Application-Centric model provides the architectural structure that AI tools need to generate maintainable code. By establishing clear bounded contexts and explicit contracts, AI can generate code that respects domain boundaries, uses proper interfaces, and integrates correctly with existing systems. Rather than producing monolithic or tightly-coupled solutions, AI working within ONDEMANDENV's constraints naturally produces code aligned with Domain-Driven Design principles, preventing the "accidental complexity" often introduced by unconstrained AI code generation.

Enver (Environment Version)

An Enver represents a specific, deployable composite version of an application's Bounded Context, as defined by a BuildDefinition in `contractsLib`. It acts as a holistic, logical environment managed as an atomic unit. Its version encompasses both its source code commit and the exact versions of all dependency Products it consumes.

Contracts Library (`contractsLib`)

The contractsLib is a dedicated, version-controlled repository (typically TypeScript) that serves as the central declaration hub and single source of truth for your entire distributed system\'s architecture and dependencies. It focuses solely on the contracts and boundaries between different services (Bounded Contexts) and teams, not their internal implementation details. This repository is the source that gets packaged (e.g., via npm pack) and provided to the platform during the initial setup process.

Within `contractsLib`, these concepts define the Bounded Contexts and how they interact.

This explicit structure defines the architecture and dependencies, linking specific Enver instances (like `OrderManagerDev`) to their build sources (`OdmdBuild`) and target environments, while managing interactions through Products and Consumers.

On-Demand Cloning (Dynamic/Ephemeral Envers)

A key feature enabling developer agility is the ability to create dynamic, ephemeral clones of the static Envers declared in contractsLib.

Cloning provides developers with nearly instant access to isolated, full-stack, high-fidelity environments based on a known good static baseline, greatly accelerating testing and iteration cycles.

Platform Abstraction: Enabling Unified Control

A core goal of ONDEMANDENV is to abstract away underlying infrastructure and system interaction complexity, allowing developers to define and control their entire Application-Centric Bounded Context via their Enver, regardless of where resources physically reside.

By abstracting the complexities of cross-boundary interactions and infrastructure management, ONDEMANDENV empowers developers to focus on their core domain logic while maintaining true, unified ownership over their entire application slice, wherever its components may run.