Skip to content
/ dvmm Public

DVMM (Domain-View Model Mapper) is a frontend architecture pattern for TypeScript projects that separates backend data models from UI models using dedicated mappers. It promotes cleaner code, better maintainability, and enables parallel development between backend and frontend teams.

License

Notifications You must be signed in to change notification settings

a2-coder/dvmm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DVMM

DOI

DVMM (Domain-View Model Mapper) is a frontend architecture pattern for TypeScript projects. It separates backend data models (domain models) from UI models (view models) using dedicated mappers. This separation leads to cleaner code, easier maintenance, and enables backend and frontend teams to work in parallel.

Core Concepts

  • Domain Model: Represents the backend API response structure. Mirrors the data contract from the server.
  • View Model: Represents the data structure needed by the frontend UI. Tailored for UI needs, not backend constraints.
  • Mapper: Contains logic to convert between domain and view models, ensuring deterministic and testable data transformations.

Why and When Should You Use DVMM?

  • When your backend and frontend evolve independently: DVMM decouples backend changes from UI changes.
  • When your UI needs data in a different shape than the API provides: View models can be optimized for rendering, formatting, or state.
  • When you want to enforce type safety and reduce bugs: Explicit mapping makes data flow predictable and testable.
  • When working in teams: Backend and frontend developers can work in parallel without blocking each other.

Best Practices

  • Keep Domain Models strictly aligned with backend contracts.
  • Shape View Models for UI needs only.
  • Never use Domain Models directly in UI components.
  • Write deterministic, unit-testable mappers.
  • Follow clear naming conventions and folder structure.

About

DVMM (Domain-View Model Mapper) is a frontend architecture pattern for TypeScript projects that separates backend data models from UI models using dedicated mappers. It promotes cleaner code, better maintainability, and enables parallel development between backend and frontend teams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •