3 ms·
As a Microsoft Developer and someone who has been fairly enamored with Silverlight I have to say I've always been weary of the MVVM model. It's a model built t
by TomOfTTB 15y ago
As a Microsoft Developer and someone who has been fairly enamored with Silverlight I have to say I've always been weary of the MVVM model. It's a model built to fit a technology rather than the other way around and it shows.
Though I admit my assessment is harsh I've always thought of it as a model designed to justify sloppy coding tricks (such as Data Binding)
So while I admire the work they put into Knockout.JS it seems like it's designed to carry a flawed model into the Javascript world (as Microsoft is seemingly abandoning Silverlight/WPF)
- stevensanderson 15y agoNo objection to your general comments, but just to clarify, knockout.js is a regular open source community project, not an MS product. Also, do try it - you might find this approach to binding to be much more compelling in a dynamic world (i.e., JavaScript).
- wccrawford 15y ago"Wary", not "weary". I'm not sure that I agree that data binding is a 'sloppy coding trick'. It's a time-saver. It enables what you were going to do anyhow, but with a lot less code. (And hopefully a lot clearer.)
- TomOfTTB 15y agoI actually meant weary as in "tired" so there! (Just kidding, I was totally wrong on that. Thanks for the correction) As far as data binding there are two reasons I consider it sloppy... 1. It's magic box coding (as in I put these simple commands in and the environment just handles it for me and I have little idea how) 2. It (by Microsoft's admission) hogs bandwidth. In the desktop world that wasn't a problem but in web applications its a big one. Which is basically my point. Data binding was a desktop application technique that Microsoft carried over into Web Forms and which is now trying to make its way into MVC. But it's not technology built with the web in mind and designing a new model around it doesn't change that. I will take Mr. Sanderson's advice in the other reply here and try the thing out but for the reasons above I don't see myself adopting it.
- Hov 15y ago>>It's magic box coding Then I wonder how you feel about eg Ruby On Rails or even jQuery for that matter. >> It (by Microsoft's admission) hogs bandwidth It's a design pattern, a design pattern so closely related to classic MVC that I find this criticism strange. I suppose you might be talking about implementing DataBinding by way of DependencyProperties in Silverlight and WPF? You can avoid that if you wish and simply implement INotifyPropertyChanged.
- ncarlson 15y agoI can't endorse KnockoutJS because I've never used it. However, I'd like to address the two points you made. > 1. It's magic box coding (as in I put these simple commands in and the environment just handles it for me and I have little idea how) Is this not abstraction? I'm not familiar with the internals of the Python interpreter, but I'm able to be productive and creative with it. > 2. It (by Microsoft's admission) hogs bandwidth. In the desktop world that wasn't a problem but in web applications its a big one. I'm not convinced that this is a problem outside of edge-case scenarios. However, from my understanding, this limitation is overcome in two ways: 1. Large application are broken up into small modules which can be loaded lazily. 2. Time. The average bandwidth of an internet user increases exponentially over time.
- TomOfTTB 15y agoI'm not sure I know what you're talking about. I was talking about Data Binding in the context of Microsoft technology. So, for example, when you want a grid to reflect an entire database table you can define the table and this with two lines of code (grid.datasource = table and then grid.databind()) the grid will reflect the table. It takes care of all the hard stuff as far as pagination, sorting columns, and even updating and deleting are taken care of automatically. It is a really quick and easy way to do things (and I don't question how amazing it is in its depth of ability). But it creates almost constant chatter as the grid is reflecting all changes off the database.
- stevensanderson 15y ago