3 ms·
If you squint a bit, the "original" MVC looks eerily similar to the one-way data flow pattern popularized by flux/redux. https://en.wikipedia.org/wiki/React_(s
by misterbwong 3y ago
If you squint a bit, the "original" MVC looks eerily similar to the one-way data flow pattern popularized by flux/redux.
https://en.wikipedia.org/wiki/React_(software)#Unidirectional_data_flow https://en.wikipedia.org/wiki/React_(software)#Unidirectiona...
edit: better link
- dfox 3y agoIndeed, what the various “reactive” frameworks do is in the end the idea behind MVC, although as they are web-based the implementation is ridiculously complex and the abstraction is very leaky.
- scrame 3y agothe purest mvc demo is pong.
- laurent123456 3y agoIn many ways it's really just MVC (at least the fat model / skinny controller style) except they renamed the elements: - Dispatcher = Controller - Store = Model - View = View And the actions are the messages sent from the user to the controller.
- MrPatan 3y agoIt may be a matter of explaining it differently. Maybe just the names! But I never "got" MVC, and I got the one way data flow pattern straight away. Maybe I was just old enough to get the point that time around.
- breadwinner 3y agoMVC is one-way. Some people think MVC is two-way data binding. That's MVVC actually.
- PlunderBunny 3y agoI'm glad I'm not the only one that doesn't get MVC. I can sort of understand it if I study a real example for a long time, but to doesn't stick. Sometimes I want to think that learning to code in the days of 8-bit computers is somehow incompatible with a lot of modern programming concepts, but maybe I'm just old and tired.
- tracker1 3y agoI think flux/redux is generally cleaner imo. But have had a tendency to think of it that way. MVC usually feels like spaghetti in contrast. And while Redux/Flux takes some mental overhead, I see so many fewer side effects in UIs that use the approach.
- DaiPlusPlus 3y ago> MVC looks eerily similar to the one-way data flow pattern popularized by flux/redux. I'm not seeing it. From TFA: > Views: A visual representation of a model. Views are updated by querying the model directly, and are notified by the model of updates. A view can update it’s model directly. A view should never know about things like keyboard and mouse events directly. I'd like to emphasise the "a view can update its model directly" part - which is exactly what Redux and React are designed to prevent: when logic in a view can mutate the model (especially when the view _also_ depends on update notifications from the model to update itself) things get impossible to reason-about. Instead, Redux/React is designed to force the view to "update" the model indirectly via actions and reducers. Another tenet of Redux+React is that the model ("state" in Redux/React) is an immutable object-graph which is replaced on every update, whereas "classical" MVC requires a mutable, long-life'd model. I feel the similarities only exist if you squint - and if you're lumping TFA's idea of MVC with React (and MVVM (groan...)) as ideas in opposition to how most people wrote/write RAD/VB6/WinForms by directly subclassing controls and overriding message-pump event-handler methods, which (I hope) everyone will agree is an approach that doesn't scale beyond building throwaway UIs.
- preommr 3y agoIf you squint almost of all software looks like MVC because it's essentially just, input(data)/processing(controller)/output(view).
- taberiand 3y agoIf you squint just a little more you'll notice a monad is just a monoid in the category of endofunctors.
- myaccountonhn 3y agoSoftware is just a giant ORM.
- rtontic 3y agoIt's all just one big state machine.
- gepardi 3y agoIf I squint, Redux is like a controller. Handles requests and response. It calls the DB, gets a response, updates state, then a view (React component) renders it.