Everything-in-html requires to program MVC actions. Those patterns are often ugly, full of gotchas, hard to learn for kiddos, and old school. Plus, when the user clicks somewhere, we gotta load the new data with REST anyway, so that makes two ways to load data and it’s prone to mistakes, twice longer to develop.
Rendering placeholders allows us to load everything via REST. The data takes the same path every time, so, fewer bugs, streamlined way of loading data, plus kiddos love the simplicity of writing REST resources in Java. Also, each visual component can be programmed in isolation, encapsulating its own concerns, rather than having to mix all data into the MVC action channel. And isolation/encapsulation is good for reliability and sharing the work across a team.
One solution is to hydrate the initial HTML with the result of REST calls, but it has drawbacks.
I know it won’t mop your sorrow. It may just help to know there is a reasonable reason for that. I also find it infuriating to look at a page that says: “3, 2, 1, Done! I’m loaded, that wasn’t so ling was it?— oh wait, gotta load my data… Theeeere you go I’m loaded! No wait, that thing as well…”
As a "kiddo" I don't have any problems with first sending a html view that is made interactive with the js added to it.
But then again I tend to avoid frameworks and thing software developers shouldn't pick completely inefficent patterns even if it is very convenient for them.
Rendering placeholders allows us to load everything via REST. The data takes the same path every time, so, fewer bugs, streamlined way of loading data, plus kiddos love the simplicity of writing REST resources in Java. Also, each visual component can be programmed in isolation, encapsulating its own concerns, rather than having to mix all data into the MVC action channel. And isolation/encapsulation is good for reliability and sharing the work across a team.
One solution is to hydrate the initial HTML with the result of REST calls, but it has drawbacks.
I know it won’t mop your sorrow. It may just help to know there is a reasonable reason for that. I also find it infuriating to look at a page that says: “3, 2, 1, Done! I’m loaded, that wasn’t so ling was it?— oh wait, gotta load my data… Theeeere you go I’m loaded! No wait, that thing as well…”