Performance: Interfaces for data models
LOW IMPACT
This concept affects the build time and bundle size but does not impact runtime rendering or user experience directly.
export interface User { id: number; name: string; } // Used only at compile time for type checking
export class User { constructor(public id: number, public name: string) {} } // Used everywhere as a class instance
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using classes for data models | 0 | 0 | 0 | [!] OK - adds bundle size |
| Using interfaces for data models | 0 | 0 | 0 | [OK] Good - no runtime cost |