Projections — Aquilia Documentation
Comprehensive guide and documentation for Projections in the Aquilia framework. View API reference, examples, and implementation patterns.
import useTheme from '../../../context/ThemeContext' import CodeBlock from '../../../components/CodeBlock' import Eye from 'lucide-react' import NextSteps from '../../../components/NextSteps' export function ContractsProjections() const theme = useTheme() const isDark = theme === 'dark' const boxClass = `p-6 rounded-2xl border $ isDark ? 'bg-[#0A0A0A] border-white/10' : 'bg-white border-gray-200' ` return ( Contracts / Projections Projections Projections let you define named subsets of fields within a single Contract. Instead of creating separate Contracts for list views vs detail views vs admin views, you declare projections and select them at render time. /* Why Projections */ Why Projections? [ title: 'One Contract, Many Views', desc: 'A single ProductContract serves list, detail, admin, and public views' , title: 'No Duplication', desc: 'Validation rules, Facet configs, and seal methods are defined once' , title: 'Security', desc: 'Sensitive fields can be excluded from specific projections' , title: 'Performance', desc: 'Minimal projections skip expensive computed/lens fields' , ].map((item, i) => ( item.title item.desc )) /* Defining Projections */ Defining Projections Projections are declared in the Spec inner class as a dictionary mapping names to field lists. )
Go to Homepage