Showing posts with label ASP.Net / MVC. Show all posts
Showing posts with label ASP.Net / MVC. Show all posts

Thursday, August 24, 2017

Visual Studio 2017 Community edition download & installation.

Visual Studio is one of famous IDE for Windows and Mac to develop apps for Android, iOS,Mac, Windows , Web and Cloud. Using this IDE we can write our code fast,Debug and Diagnose with ease.
Please get more details about Visual Studio here : Visual Studio

Visual Studio Community is free for all developers or students and in this post we will see step by step instructions to install Visual Studio Community 2017.

Step 1 : Go to link https://www.visualstudio.com/downloads/  to download VS 2017 community edition.

Step 2 : Click on Free Download button of Visual Studio Community 2017 IDE

Step 3: Run the downloaded setup executable file vs_community_xxx.exe

Step 4: Accept the Microsoft Terms and Conditions and click Continue


Step 5: Select VS 2017 different components as per your development preferences. I have selected following as per my preferences

  1. Universal Windows Platform Development
  2. .NET desktop development
  3. ASP.NET and Web development
  4. Mobile development with .NET using Xamarin
  5. Mobile development with JavaScript 
  6. Click on Install



Step 6: Once you click Install it will start installation as per your selection and necessary files will be copied to your system.


Step 7 : After successful installation please Launch the IDE.


Post your questions or comments bellow. Thank You!

Thursday, August 10, 2017

What is the MVC pattern?

The Model-View-Controller (MVC) architectural pattern separates an application into three main groups of components: Models, Views, and Controllers.Using this pattern you will achieve "Separation of Concern"  : Separate application into different layers so individual team can focus on their modules only. MVC pattern helps to create those layers and all layers are having their own responsibilities in the application which we will discuss later in this post.

All user client requests are routed to a Controller which is responsible for working with the Model to perform user actions and/or retrieve results of queries. The Controller chooses the View to display to the user, and provides it with any Model data it requires.View use that model data and rendered the final response and that will relay back to the client.



If your application is built if you keep all layers together then it will be difficult to scale,debug and enhance the application. MVC pattern come with different responsibilities on different layers which help to scale application easily. For Example UI changes are more compare with application business  rule change. so if you keep UI layers separate from business logic layers you will have chance to less errors during those UI change.

Both Controller and View depend on model however model is neither depend on Controller or View. This separation allow developer to test Model to be built and tested separately.

Now let's take a look individual responsibilities in details as mentioned.

Controller Responsibilities:-
  • Controller is responsible to handle every user(client) requests, work with model and identify appropriate view to render final response.
  •  Controller is the initial entry point, and is responsible for selecting which model types to work with and which view to render hence it's name is given as "Controlller"
  • The view only displays information; the controller handles and responds to user input and interaction

Model Responsibilities 
  • The Model in an MVC application represents application business logic or operations that should be performed by it.
  • It also maintain the state of the application and notify the change in data.
  • Model is responsible for storing and retrieving data from different data repositories. 
  • Strongly-typed views will typically use ViewModel types specifically designed to contain the data to display on that view
  •  The controller will create and populate these ViewModel instances from the model.

View Responsibilities 
  • Views are responsible for presenting content through the UI.
  • .Net use Razor view engine to embed .NET code in HTML markup
  • We should keep minimum logic in view which is only related to present data.
  • View use models and create final rendered HTML which will send to client as response.
Hope this article has given some basic idea of MVC pattern.

Please post your any questions in comments bellow. Thank You !