4 ms·
You don’t throw those design lessons away! They are still very much in use and the standard for writing the modern web. Everything is based off the Gang of Four
by hoofhearted 5y ago
You don’t throw those design lessons away! They are still very much in use and the standard for writing the modern web. Everything is based off the Gang of Four, and MVC has evolved to MVC-P, Model-View-Controller on the backend, with a Presentation layer on the front end. ReactJS for the presentation layer in your case. All the above, still based on the 23 Gang of Four design patterns.
- PaulDavisThe1st 5y agoI just opened my copy of Gang of Four. Almost none of the patterns there are exclusively GUI focused ... I might even go so far as to say that none of them are, but that's probably a little too strong of a claim to make. I was really asking about the design patterns used in native/desktop GUI applications like widgets (including a wide range of widgets almost none of which seem to be offered by any/most web frameworks), anonymous callbacks/closures, explicit event loops etc. Also, last time MVC "evolved" in a native context was, to the best of my knowledge, Microsoft's introduction of M-VM-VC where "VM" is "View Model", a slimmed down GUI-centric version of the "real" model. This way you're describing a "presentation layer" ... I don't see where the distinction between that and a traditional "View" is (or "Controller" for that matter, since in most GUI contexts, the View and Controller are frequently occupying the same pixels on a display. My guess would be that the "View" in the design you're referring to is some particular aspect of the fundamental model, rather than an actual mechanism of making the model visible to the user.
- hoofhearted 5y agoThe Flux design pattern created by Facebook, and used by Redux and nearly every ReactJS app, is by definition a State Design Pattern as described in Gang of Four lol.
- PaulDavisThe1st 5y agoFrom the book: "Allow an object to alter its behavior when its internal state changes. The object will appear to change its class". You think that's somehow primarily a GUI-related pattern? Let's see what the authors say about "Motivation" "Consider a class TCPConnection that represents a network connection. ..." Oh, right. It has nothing to do specifically with GUI programming, but is, like more or less all the other 22 patterns, a general pattern for writing good object oriented code. Everyone should know these patterns. It's great if ReactJS pushes people towards using this one. It doesn't have much to do with UI/UX implementation in either web or native contexts, IMO.
- hoofhearted 5y agoOops my bad Paul, I think you are correct! I didn’t bother to look at the username before I started commenting. But to further the convo, State isn’t a GUI related pattern. It’s the dominant design pattern used by modern JS frameworks for persisting data across the GUI. “Consider a Redux class ProductState that represents an Axios network connection. …”