MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Exploring What is New in ASP.NET MVC

Published on 01 May 15
606
0
3
Exploring What is New in ASP.NET MVC - Image 1

When we look around in today's world, what we see is devices all around. Devices from mobiles to tablets to computers surround us and now the world is talking about internet of things. IOT means communicating between devices where each device will provide some relevant information to other so as to provide a customer with highest level of service. Example can be a Phone providing information about the user reaching home in around 10 minutes so that the AC can switch-on itself.

So here, when we can speak about communication or talk about internet and with internet; comes a world that suddenly seems much smaller than it is. Websites and applications are the main medium/interface using which people share and get information with each other. So how do this happen? To make a website we need a platform that is robust and reliable enough to handle huge traffic (people coming in to view website), should deliver better performance, provide enterprise level security and importantly should have minimal up time(time from development to production).

What to choose and why?
Important question that comes into picture now is what should be used to build such an application. There are various technologies like Java, Php, Python, and Node.js to name a few. So what is the advantage of using .net over them? Main advantage of using ASP.NET is the time that it takes to build an application from on paper to the actual server. It is far less than that of java. Then comes the fact that we can use any language from C#, F#, C to C++ to build components all the languages mentioned are compiled languages which gives us an advantage over interpreter languages like Python, JavaScript (nodejs), etc. Yes, there are compliers that are built to compile languages like Python but the ASP.NET supports concurrency and asynchronous pattern, which gives it an advantage over interpreted languages. Then comes the enterprise level support that it has due to vast experience of over 12 years in enterprise industry. In addition, another fact is that ASP.NET has a good set of stable plugin's and CMS's built around it, which helps us build enterprise solutions at rapid speed.

ASP.NET is a framework that has evolved over the time. Its major breaking change was when it started supporting MVC. This pattern allowed .Net to dump the old page life cycle pattern, which at times caused hindrances and also performance issues as for every click or a postback whole page life cycle events used to get executed. Also as the time passed the processing power of the machines improved. Now the client side scripts play a major role when architecting a solution as they help reduce the load of the server to a good extent as all the rendering logic is handled/processed by the client machine. Also there are various plugins developed in JavaScript that handle graphics and animations like pro. This gives a website a good look and feel and also since they are handled at client end they help the server to focus on processing the actual business logic.

The MVC architecture
MVC architecture is loosely coupled. This means that the server is only concerned about the data that it needs to send to client and then its client's responsibility to handle that, as it wants. Hence, every single entity has a predefined role. One more advantage of this is that anytime we can replace the whole entity without even disturbing the other. Example: Suppose we have used Jquery to handle the rendering logic of the webpage but then later we found that React or Angular serve the purpose better so we can easily replace the client side logic with ours and it will not require a single code change at server logic. Since the server, side is just concerned about the data that the client passes it to process and the data that it needs to send.

MVC also had its own demerits even though it is a great architecture. Now with the evolution of MVC6 most of the demerits that MVC5 had are resolved the architecture is further enhanced to improve the performance and stability of the application that is built. MVC6 along with ASPNET 5 has taken a pick from best of various other technologies like Python, Nodejs so that it can provide a one-stop solution to the problems in hand.

The major advantages of MVC6 are as follows:

  1. The time has gone when we use to say that only Microsoft servers run Microsoft technologies. ASP.NET 5 is built to support Linux distros and MAC OS as well.
  2. Another major feature is use only what you need i.e. everything now is a middleware so we can now plug-in a piece of code that we want to run for a request. This means that we will only register the features that we need and the MVC will load them on startup. Hence, a performance improvement since we are only running what we need. If we do not need sessions for our website, we will not add them to our start-up and hence will save our processing of sessions middleware.
  3. Dependency Injection is a built-in feature of the framework. What does this mean for us? This means that now our application is more loosely coupled and testable. Using dependency injection we inject dependencies at runtime, since these dependencies are resolved at runtime we can easily replace them without changing the core functionality of the project. Example: We have a class say Price Calculator, which implements IPrice that calculates and returns a price for our product, but now we need to provide discount on certain days of the year. So suppose we implement a different class say Discount Calculator which will host the logic of calculating the discounted amount and then just need to replace the configuration to load one class on special days and replace it with other on the other days (Very vague example but just to give you a gist of it).
  4. ASPNET now has core framework which means that now if the underlying machine does not have the .net framework then too its fine. The ASPNET 5 will be built as a complete deployable package, which would contain the whole 11 MB framework and the rest of libraries to support our application. Also this means that now we can run two different .net frameworks on a single machine as both run on their own app domains which was not possible until now. Hence no need of IT team approval now as we need not change the server configuration to support the new framework as it is a self-contained entity.
  5. All the configuration files are now in json. What is the advantage of this? Advantage is that json format consumes far less space than xml when we consider huge files. Also reading a json file is much faster than an xml file. In the end, it means better performance for the application.
  6. One major feature is that now we do not use System. Web for Http Context. Also now, the Http Context will hold about 2kb of data instead of 30kb. This means further performance increase as now we would have to process far lesser data on every request. Also far, less data would be transferred between method calls this in turn enhances performance.
  7. MVC till now did not had a perfect replacement for user control that we use to have in web forms, but now with the introduction of View Components it has provided a solution. View Components act like mini controllers with better separation of concerns and usability. They are invoked like calling a function.
  8. The crucial part is, it's also open source.

Apart from the features mentioned above there are also list of features that are currently in process, hence will update the article as and when they come into picture. Also there is some document management like library that is built which is taken as a reference from python.




















Exploring What is New in ASP.NET MVC - Image 1

When we look around in today's world, what we see is devices all around. Devices from mobiles to tablets to computers surround us and now the world is talking about internet of things. IOT means communicating between devices where each device will provide some relevant information to other so as to provide a customer with highest level of service. Example can be a Phone providing information about the user reaching home in around 10 minutes so that the AC can switch-on itself.

So here, when we can speak about communication or talk about internet and with internet; comes a world that suddenly seems much smaller than it is. Websites and applications are the main medium/interface using which people share and get information with each other. So how do this happen? To make a website we need a platform that is robust and reliable enough to handle huge traffic (people coming in to view website), should deliver better performance, provide enterprise level security and importantly should have minimal up time(time from development to production).

What to choose and why?
Important question that comes into picture now is what should be used to build such an application. There are various technologies like Java, Php, Python, and Node.js to name a few. So what is the advantage of using .net over them? Main advantage of using ASP.NET is the time that it takes to build an application from on paper to the actual server. It is far less than that of java. Then comes the fact that we can use any language from C#, F#, C to C++ to build components all the languages mentioned are compiled languages which gives us an advantage over interpreter languages like Python, JavaScript (nodejs), etc. Yes, there are compliers that are built to compile languages like Python but the ASP.NET supports concurrency and asynchronous pattern, which gives it an advantage over interpreted languages. Then comes the enterprise level support that it has due to vast experience of over 12 years in enterprise industry. In addition, another fact is that ASP.NET has a good set of stable plugin's and CMS's built around it, which helps us build enterprise solutions at rapid speed.

ASP.NET is a framework that has evolved over the time. Its major breaking change was when it started supporting MVC. This pattern allowed .Net to dump the old page life cycle pattern, which at times caused hindrances and also performance issues as for every click or a postback whole page life cycle events used to get executed. Also as the time passed the processing power of the machines improved. Now the client side scripts play a major role when architecting a solution as they help reduce the load of the server to a good extent as all the rendering logic is handled/processed by the client machine. Also there are various plugins developed in JavaScript that handle graphics and animations like pro. This gives a website a good look and feel and also since they are handled at client end they help the server to focus on processing the actual business logic.

The MVC architecture
MVC architecture is loosely coupled. This means that the server is only concerned about the data that it needs to send to client and then its client's responsibility to handle that, as it wants. Hence, every single entity has a predefined role. One more advantage of this is that anytime we can replace the whole entity without even disturbing the other. Example: Suppose we have used Jquery to handle the rendering logic of the webpage but then later we found that React or Angular serve the purpose better so we can easily replace the client side logic with ours and it will not require a single code change at server logic. Since the server, side is just concerned about the data that the client passes it to process and the data that it needs to send.

MVC also had its own demerits even though it is a great architecture. Now with the evolution of MVC6 most of the demerits that MVC5 had are resolved the architecture is further enhanced to improve the performance and stability of the application that is built. MVC6 along with ASPNET 5 has taken a pick from best of various other technologies like Python, Nodejs so that it can provide a one-stop solution to the problems in hand.

The major advantages of MVC6 are as follows:

  1. The time has gone when we use to say that only Microsoft servers run Microsoft technologies. ASP.NET 5 is built to support Linux distros and MAC OS as well.
  2. Another major feature is use only what you need i.e. everything now is a middleware so we can now plug-in a piece of code that we want to run for a request. This means that we will only register the features that we need and the MVC will load them on startup. Hence, a performance improvement since we are only running what we need. If we do not need sessions for our website, we will not add them to our start-up and hence will save our processing of sessions middleware.
  3. Dependency Injection is a built-in feature of the framework. What does this mean for us? This means that now our application is more loosely coupled and testable. Using dependency injection we inject dependencies at runtime, since these dependencies are resolved at runtime we can easily replace them without changing the core functionality of the project. Example: We have a class say Price Calculator, which implements IPrice that calculates and returns a price for our product, but now we need to provide discount on certain days of the year. So suppose we implement a different class say Discount Calculator which will host the logic of calculating the discounted amount and then just need to replace the configuration to load one class on special days and replace it with other on the other days (Very vague example but just to give you a gist of it).
  4. ASPNET now has core framework which means that now if the underlying machine does not have the .net framework then too its fine. The ASPNET 5 will be built as a complete deployable package, which would contain the whole 11 MB framework and the rest of libraries to support our application. Also this means that now we can run two different .net frameworks on a single machine as both run on their own app domains which was not possible until now. Hence no need of IT team approval now as we need not change the server configuration to support the new framework as it is a self-contained entity.
  5. All the configuration files are now in json. What is the advantage of this? Advantage is that json format consumes far less space than xml when we consider huge files. Also reading a json file is much faster than an xml file. In the end, it means better performance for the application.
  6. One major feature is that now we do not use System. Web for Http Context. Also now, the Http Context will hold about 2kb of data instead of 30kb. This means further performance increase as now we would have to process far lesser data on every request. Also far, less data would be transferred between method calls this in turn enhances performance.
  7. MVC till now did not had a perfect replacement for user control that we use to have in web forms, but now with the introduction of View Components it has provided a solution. View Components act like mini controllers with better separation of concerns and usability. They are invoked like calling a function.
  8. The crucial part is, it's also open source.

Apart from the features mentioned above there are also list of features that are currently in process, hence will update the article as and when they come into picture. Also there is some document management like library that is built which is taken as a reference from python.

This blog is listed under Open Source and Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top