4 ms·
It's not that there's an additional layer, the rendering of the view was always there, just tightly coupled to fetching data from the DB. It is now a better pr
by atoko 9y ago
It's not that there's an additional layer, the rendering of the view was always there, just tightly coupled to fetching data from the DB.
It is now a better practice to create a BFF that can serve more clients than just browsers.
- weberc2 9y agoIt's not tightly coupled to the database, it's just not on the browser. And because they aren't tightly coupled, you can still make the renderer the client of your REST/gRPC API just as you would the browser. Or it may be more practical to have your non-browser clients talking to your API while your renderer talks directly to the database.
- atoko 9y agoYour second choice is just coupling it again. I've only seen few frameworks that let you render both HTML and json (Ruby on Rails). You still have to map a model to HTML, regardless.
- weberc2 9y agoYes, that's my point. Decoupling it for the purpose of supporting multiple frontends may not be more practical than leaving it coupled and providing an API for other frontends.