News for hackers. Stuff that matters.
Re:Generating JSON Directly from Postgres by rualca on Friday July 16, 2021 @02:11AM (#27853457)
> Yeah. This is the problem: we've abandoned the hypermedia architecture of the web for a dumb-data, RPC model.

I'm not sure that's the issue at all.

The article complains about boilerplate code used to convert results to JSON. To me those complains make absolutely no sense at all, because that boilerplate is used for two things: validate data, and ensure that an interface adheres to it's contract.

It makes absolutely no sense at allto just dump JSON from the outside world into a db without validating or mapping. And vice-versa. That's what the so called boilerplate does.

What's more astonishing is that nowadays the so called boilerplate is pretty close to zero, thanks to the popularity of mapping and validation frameworks. Take .NET Core for example, and modules like AutoMapper and FluentValidation. They map and project and validate all the DTOs with barely any noticeable code. Why is this a problem?

There are no comments on this comment yet.