News for hackers. Stuff that matters.
Re:MVC Isn’t MVC by throw310822 on Tuesday June 20, 2023 @02:57AM (#36400610)
> You take a table from the database and put it into an html tag table.

> Do you want your view to know how to connect to a db?

I think this is where there's a misunderstanding: you think of your model as "a database". A database is not a model, a database is just a storage layer. A model is an object that provides an api with high-level business operations and views on data.

At that point, your view needs only to receive from the model the pre-digested data it provides and translate it into html. Similarly, the controller only needs to translate user input in terms of high-level operations on the model, without ever having to interface with a database.

Re:MVC Isn’t MVC by bonzini on Tuesday June 20, 2023 @04:12AM (#36401052)
In fact the original MVC was done with Smalltalk which has a persistent image. So the Smalltalk system itself _is_ the storage layer in which model objects live.
Re:MVC Isn’t MVC by cies on Tuesday June 20, 2023 @06:56AM (#36402228)
This!

Also the original MVC (not the req-resp cycle Model2) was not for client-server split apps. It was for desktop apps, so the Model could update the view. Now with WebSockets we're coming full circle.

Re:MVC Isn’t MVC by 0tt049 on Tuesday June 20, 2023 @11:15AM (#36405200)
Exactly! No rows, tables or SQL. But instances of Models in a persistent image.
Re:MVC Isn’t MVC by DougBTX on Tuesday June 20, 2023 @05:22AM (#36401564)
> A model is a ... view on data.

I think this is part of the reason the MVC names persist, they are so generic that you can describe the Model as a type of View!

Re:MVC Isn’t MVC by layer8 on Tuesday June 20, 2023 @05:58AM (#36401809)
MVC “view” is on the user level, the model is a “view” (facade/adapter/whatever) on the programmatic level.