MVC Isn’t MVC
111–120 of 165 posts
Re: MVC Isn’t MVC
#112More complex cases are for example a combo box, which consists of a text input, a dropdown button, a dropdown list, which in turn may have a scrollbar. And this is just one relatively basic control within a potentially much more complex UI.
I’ve never seen a systematic treatment of that topic. Given that UIs use nested controls, one would think that this would be widely addressed by architectural patterns for UIs.
Re: MVC Isn’t MVC
#113What MVC refers these days is not of MVC from 1979 but from the Design Patterns by Gags of Four and they did not mean the patterns should be applied strictly as is. So.. what? What is the point of the article? He does not seem to really understand the purpose of design patterns and it in practice
Re: MVC Isn’t MVC
#114One question which always preoccupied me is how those MVC components interact with nesting/recursion. For example, a view may include a scrollbar, which has state, and can be interacted with, sometimes independently from the model displayed by that view. So the scrollbar has it’s own model (containing e.g. the scrollbar position) and it’s own view (responsible for how the scrollbar is rendered) and controller (allowi…
If you want to do sth special on the account page modal scroll, you issue a specific event for that, and deal with it in the same way as any other.
It is a very simple and clean model, but not complicated enough for some people :) of course it helps that with a good type system you can catch missing or incorrect cases.
Re: MVC Isn’t MVC
#115for simple web application backends, why does one need more than just "models" (structs, that describe database tables/rows, using something like "an ORM" but more lightweight, so as to provide query building, caching, etc.) and "routes" (procedures, mapped to URL patterns, that execute logic such as accessing models (cached or queried) and then responding with output from a simple HTML template system, or possibly a…
I'm using Sveltekit and doing pretty much what you're doing, and never touched Rails before. I'm equally confused about the MVC pattern I hear so much, and why it was so big back then, and why it isn't very big now. Was this more of a design / architecture "fad" or a design around the constraints of the time?
Initially when the mindshare began to move to the client code, front end tool chains actually did do a lot of hemming and hawing of what variant of mv* they were. Eventually tools like react came around and whatever variant of mv* they were wasn’t what was interesting about the building paradigm. More or less that’s where we are now.
Re: MVC Isn’t MVC
#116For OpenStep/NeXTSTEP style MVC, which is very similar to the original MVC, is well explained in the book "OpenStep for Enterprises", https://www.amazon.com/OpenStep-Enterprises-Nancy-Knolle-Cra... . I just cannot understand why the author says it's different from ST80 style MVC.
Re: MVC Isn’t MVC
#117A bit pedantic. It’s just a design principle not a scientific law.
Re: MVC Isn’t MVC
#118One question which always preoccupied me is how those MVC components interact with nesting/recursion. For example, a view may include a scrollbar, which has state, and can be interacted with, sometimes independently from the model displayed by that view. So the scrollbar has it’s own model (containing e.g. the scrollbar position) and it’s own view (responsible for how the scrollbar is rendered) and controller (allowi…
Re: MVC Isn’t MVC
#119One question which always preoccupied me is how those MVC components interact with nesting/recursion. For example, a view may include a scrollbar, which has state, and can be interacted with, sometimes independently from the model displayed by that view. So the scrollbar has it’s own model (containing e.g. the scrollbar position) and it’s own view (responsible for how the scrollbar is rendered) and controller (allowi…
This is what MVVM is for. Last two letters mean View Model - a model of the view - data structures for each user control, and code that synchronizes these structures with Model structures.
Re: MVC Isn’t MVC
#120Earlier quoted context omitted.
> 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 re…
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.
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.