top | item 30522593

(no title)

danellis | 4 years ago

Separation of concerns. The person writing the HTML should get to decide where the data is rendered in the page, not the person generating the data. What you've done (as far as I can tell) is unnecessarily couple the backend to the structure of the presentation layer.

discuss

order

wwweston|4 years ago

Someone doing all the content addressing within PHP would indeed be coupling the backend, and while I can imagine that being conditionally useful you're probably right that it would have drawbacks as a general pattern.

Someone using the Content Addressing Sheets feature of CAST would actually be adding an additional layer of separation:

* HTML - document structure with decorating attributes/semantics

* Content Addressing Sheet - determines where in the document computed content is displayed

* Domain Logic - determines values to be computed

The CAS is a CSS-like DSL that is very much not the backend host language (though it may invoke things defined within that language).

Will the same person author the HTML and CAS? Not necessarily, but it's certainly as plausible as someone authoring an HTML file with template syntax sprinkled around.