2 ms·
Certain niceties of MVC break down once your project falls outside of the mold of a cookie-cutter CRUD app interfacing with a 100% Microsoft ecosystem. I guess
by kenjackson 15y ago
Certain niceties of MVC break down once your project falls outside of the mold of a cookie-cutter CRUD app interfacing with a 100% Microsoft ecosystem.
I guess my question would be, what's an example of this. I find MVC with Razor extremely productive. I rarely even think of a framework when I'm using it -- I'm just typing what I'd like to make happen (for the most part).
And for me the tooling makes my life much easier. I know this is controversial statement for Django/Rails devs who are pretty much vi/emacs devs, but simple things like being to jump between quickly seeing all defs/uses/implementations of a method/property/class/assembly is extremely useful. But I hacked away on vi for almost 20 years, so I realize its allure.
- spamizbad 15y ago> I guess my question would be, what's an example of this. One example that stands out to me in the whole concept of strongly typed views. Nice in theory, but ultimately tightly coupling your view to your model (or your model to your view, depending on your perspective) is very Webforms-ish. You can tell they put in place these practices to ease adoption among the current crop of vanilla ASP.NET developers. Another example is being able to quickly bake-in full-text-search into your application. With Python/Django you can use something like Haystack. Ruby has equivalents. With MVC, what are your options? Do it by hand with Lucene.NET? Get there a bit faster with .NET connector for Solr? This is more of a .NET ecosystem complaint, but ecosystems matter. > And for me the tooling makes my life much easier. I agree. Working with Visual Studio is great. With that said, I missed being able to "edit on the fly" my Python code and immediately pop into the browser to check, so now I just have a build script that builds and stages my projects automatically on an IIS server so I can accomplish what I got for free in Python/Django.
- smhinsey 15y agoI think strongly typed views are an area where things fall down due to lack of guidance rather than design. I don't think a view model is the same thing as the model in MVC. In my MVC apps, I use them pretty much exclusively, but they exist completely independently from my application model (they represent compositions thereof). This really only makes sense in apps of a certain scale, though, so having the option not to use them, or to use dynamic views (not sure if they count as strongly typed, but they are a weird middle ground) is definitely useful.
- notJim 15y agoIn reply to your first point, you should really consider using ViewModels. It a) makes views cleaner because it gives you a place to put formatting, and b) provides for some element of decoupling your views and models. If you're passing models directly to views with Django, don't you have exactly the same problem?
- lusr 15y agoWhat's wrong with strongly-typed views? I appreciate having the compiler do type checking for me so that I don't have to write a bunch of unnecessary unit tests to do the checks, and it makes refactoring straightforward. More importantly, on projects with larger teams, a strongly-typed view model means other developers can quickly understand expectations without having to dig into the view details, and designers can work on the view according to a fixed, documented and explicit contract independent of the progress of the implementation. If you're working on a small, simple application with 2 or 3 other developers maybe it's not that big a deal, but on medium+ sized line of business application teams with 20+ developers it makes a massive difference when you need to fix somebody else's bug in an area you don't have much background in. And what problems did you have building full-text search into your application? I used SQL Server + Full Text catalog for the first time ever recently and I was up and running in a few minutes. That being said I'm not familiar with what Lucene offers, so maybe you have something in mind that SQL Server does not support.
- notJim 15y ago> I guess my question would be, what's an example of this. I don't know if this is exactly what your parent had in mind, but I found it relatively difficult to make a REST API. I had to work around a lot of things with model binding and routing to come up with my solution, and even after that, I still find it kind of hacky. In addition to that, IIS fights you at several points along the way, for example by adding spurious HTTP headers or doing things like automatically redirecting certain status codes. With a framework likes rails, this is baked right in. With the PHP framework I used to use, the framework was so transparent and lightweight that it was trivial to bend it to my whim. A lot of this was exacerbated by the fact that it was much harder than it should be to set up my project to use the source code for the framework that it should be. In thoery, you just grab the project from MS, add it to your solution and change some references, but in practice, if you're using any other libraries that were built against the DLL from Microsoft, you run into issues, because the MS DLL is signed, and the DLL you build from source is not.