by splawn · 3mo ago · 0 comments
Don't you have to maintain that separation either way? Your core/application logic shouldn't know how its result is ultimately represented. That could be JSON or HTML over HTTP, Protobuf over a TCP stream, or a custom binary protocol over a Unix socket.
Obviously those representations matter at the presentation/transport boundary, but why should choosing HTML force that concern into the business logic?
So instead if returning data (JSON, XML, whatever), every part of your API now needs to return parts of client-side UI, and be aware of changes in it.
I understand the issue of mixing state models.. angular SPA style vs HATEOAS.
But that still doesn't answer what I was asking about mixing presentation concerns into business logic. Returning HTML means the presentation layer has to know about HTML. Why would that require the business logic to know about it?