View And Representation Patterns

Producing the response: Template View, Transform View and Two Step View as three ways to turn a model into output, and what each becomes in a JSON API, a server-rendered page or a hypermedia fragment. Use when logic is accumulating inside templates, when a template triggers database queries during rendering, when the same data must be rendered in several formats and the mapping is duplicated per format, when a consistent look or envelope must be applied across every screen or endpoint, when entities are being serialised directly to clients, when a response shape is decided by whatever the service happened to return, or when server-rendered fragments and a JSON API are both being served from the same handlers. Does not cover routing and cross-cutting request concerns (mvc-and-request-handling), the remote operation's granularity and its payload contract (remote-facade-and-dto), compatibility and versioning of that contract (rpc-and-api-contracts), or serialisation throughput (serialization-performance).

robsonkades 9759344 4 files · 29.2 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/view-and-representation-patterns commit 9759344e0f

Frequently asked questions

npx skillmds@latest add robsonkades/view-and-representation-patterns