0

I have been wondering whether this combination of technologies would work. I can implement a modular web application with MVC, EF, and utilize AngularJs if I would want to play around with the technology to implement sort of a mini SPA. I would like to extend my knowledge a bit further, and I was wondering whether I could utilize node.js instead of EF for relational database communication. Can I intermingle MVC back end with AngularJs for front end (mixed with MVC), and node.js for database communications

17
  • 1
    When you say "MVC" are you referring to ASP.NET MVC? "MVC" all by itself is a software architectural pattern, not a specific technology. Commented Aug 1, 2016 at 16:19
  • 1
    your question is all over the map. node.js isn't a replacement for Entity Framework..... Commented Aug 1, 2016 at 16:33
  • So, what you are suggesting is technically possible, but highly impractical. It would require your server to be running two instances of a server-side framework and to be configured to listen on different ports for each one, and then synchronize data/logic between the two. TLDR; don't do this. Commented Aug 1, 2016 at 16:35
  • 1
    @lucas Yes, that is semi-correct - technically node would be a replacement for IIS, which is the server that ASP.NET runs on, but any server-side code to handle http requests, DB calls, etc. running on node.js would be a replacement for ASP.NET. And again, MVC is simply an architecture. Commented Aug 1, 2016 at 16:51
  • 1
    @lucas As for RDBMS for node.js, a quick google search will get you some common results, but you can also check out the rdbms keyword on the npm site. Some examples include MySQL, postgreSQL, etc. link is here: npmjs.com/browse/keyword/rdbms -- see also this link for MySQL for node article: sitepoint.com/using-node-mysql-javascript-client Commented Aug 1, 2016 at 17:01

1 Answer 1

1

Is it possible? Yes, technically, but it would be very bad practice.

ASP.NET's MVC does nearly everything server-side. This means that views are built within the server and sent to the user. The controller is also server side.

With AngularJS, this paradigm is flipped on its head. The controller and view are both client side. The server sends the user all of the views and controllers at once, and then from then on only serves data. This is very attractive for single-page applications, and sites that want to exchange data, but not have to constantly send a new view. NodeJS is a popular architecture to use for the server, but any server architecture will work fine with Angular.

Both systems have their pros and cons, but there is no sane reason I can think of to use them together. You can certainly use ASP.NET as the server/model for an AngularJS application, but I'd discourage you from using APT.NET MVC with Angular.

Sign up to request clarification or add additional context in comments.

8 Comments

gotcha, this is only for studying purposes, not necessarily for practicality. I develop application with meny technologies combined, and I did not touch node.js just yet, just was wondering whether it is possible, so I can jump into studying it as well (combining it with the technoglies I already know). thanks
I 100% agree with everything here except "I'd discourage you from using ASP.NET MVC with Angular". We use Angular on top of ASP.NET MVC in production and it works great. You can still utilize the benefits of the MVC framework, but also leverage the power of Angular. A great example of this is passing a model or viewbag data to a view, and then injecting that into your Angular controller.
@mhodges Quite interesting! I can see how that could work well.
Yes, with AngularJS you can implement mini SPA wit ASP.NET MVC.
@LucasWatson Angular and Razor also play nicely together in that you can use a razor HTML helper for say, building a dropdown list from viewbag data, but then use any ng-* attributes on that as well and it will do everything you need from the Angular side
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.