SlideShare a Scribd company logo
ASP.NET MVC 3 Rapid Application Development<br />Mădălin Ștefîrcă and Victor Chircu<br />Abstract. This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 using Microsoft Visual Studio 2010. It will describe why creating a new web application using Mvc 3 is a lot easier and faster and also present simple ways to develop such applications.<br />Introduction<br />The paper will describe to you the simplicity of developing a web application using Microsoft’s ASP.NET MVC3. Starting with the creation of a new project, adding new items, and quickly adding functionality including modeling, databases CRUD operations, UI elements etc. There will be a brief presentation of the Html Helpers provided by Visual Studio, and the use of Dynamic Templates and how they can help you and a comparison between MVC 3 and Web Forms, the main web oriented frameworks provided by Microsoft.<br />Creating a new project<br />Creating a new project is easier than ever. You can create an emtpy project allowing you to structure it the way you think is best fit, or you can choose to create a new Internet Application that will create for you a fully functioning project and fully extensible. It is recommended to choose the second option, because this way you will not have to worry about the project structure and start developing since the very first minute. If you watch Fig.1 you can notice that Visual Studio has buit for you separate folders for Controllers, Views, Models, Scripts, Content. <br />If you check the packages.config file you can also see that Visula Studio also added some useful packages for you like jQuery, jQuery-UI, jQuery.Validation meaning javascript libraries that will greatly improve your development and are very common to an experienced developer. The Entity Framework nuGet package is installed also by default and it comes in handy when working with complex databases since most of the work is done by this ORM (Object Relational Mapping tool ).<br />In the Viewshared folder you will find two .cshtml files, _Layout, used as a master page in the application, and Error, used as an global error page displayed to the user when the server crashes. These two are also added by default when creating a new MVC3 project. <br />If you run the application you will notice that you have a fully functional project including a minimal authentication system that allows you to register users and authenticate them later on.<br />Fig.  SEQ quot;
Figurequot;
  MERGEFORMAT 1. <br />Adding new items<br />Models<br />Visual Studio also has provided for you an easy way for adding new items to your projects. You  can add a new class in the Models folder that will be our new model. Right click the Models folder and select Add/Class. Name the class Employee and click Add. Inside the class you type “prop” and click the Tab key. This will instantly create for you a default property. Pressing the Tab key will switch you through the property type and property name in order to change them. Make for a start two  properties of type string and name them Name and CompanyName and an Id. Still inside the class, if you type in “ctor” and press Tab key it will automatically generate a constructor for you. Inside the constructor assign the CompanyName property a string. Now you have your first model. Your code should look like this:<br />public class Employee<br />    {<br />        public Employee()<br />        {<br />            this.CompanyName = quot;
Fictional Companyquot;
;<br />        }<br />public int Id { get; set; }<br />        public string Name { get; set; }<br />        public string CompanyName { get; set; }<br />    }<br />Context<br />Now we will have to add a context for Entity Framework database. Int he Models folder add a new class. This should inherit the DBContext object from System.Data.Entity. Add a property to the class that should look like this:<br />public class EmployeeContext : DbContext<br />    {<br />        public DbSet<Employee> Employees { get; set; }<br />    }<br />And now you have your context.<br />Controllers<br />To add a new controller, you simply right click the Controllers folder and select Add/Controller. You type in the controller name, and then you get to choose between several scaffolding options like and empty controller, controller with empty actions or controller with read/write actions and views. The latter is the easiest way to develop. Choosing this option will require you to set the model class and the data context. Our model is Employee and context is EmployeeeContext. After selecting those previously mentioned click Add. This will generate you the whole mechanism required for CRUD (Create, Read, Update, Delete)  operations over the Employee entity, including database operations, and UI. If you take a look in the Views/Employees folder you will see that Visual Studio has already generated all the html you need for the actions. If you run the application in your browser and go to host/Employees you will have the full functionality done.<br />Html helpers<br />Html Helpers are provided by visual studio as support for rendering HTML controls in a view. It has a wide variety of choices like generating a link, forms, or even inputs or validations for inputs based on a predefined model. Also these helpers are highly extensible, customizing them being a great benefit for development.<br />@Html.EditorFor(m => m.Property)<br />@Html.DropDownListFor(m => m.Property, customSelectList)<br />Dynamic templates<br />Templates are used to display a predetermined portion of the page layout which also contains fill-in-the-blanks that can be filled at run time. Template saves a lot of time because it can be reused in many places. Razor view engine includes a feature called Inline Template which allows you to define a portion of dynamic HTML that can be reused. Also using Razor template you can pass template as a parameter to a method.<br />You can make this for display or edit mode. All you must do is to set the @model of the template to the desired type. This can be a struct, a class, or even a collection. You can call this templates either by setting the name of the templates exactly the same as the type of the property of the model, or by setting an attribute to the property [UIHint(“templateName”)].<br />Alternatives<br />The main advantages of the ASP.NET MVC 3 are that it enables full control over the rendered HTML, it provides clean separation of concerns, easy integration with javascript, RESTful urls that enables SEO, no ViewState and PostBacks events. The web forms provide a wide variety of RAD elements, like drag & drop, automatic event generation, and it is easier for developers coming from the winform development to adapt. Another big plus for the web forms framework is the maturity -  it  has been around since 2002 and there is a big amount of information regarding solving problems. Both of them are good choices, neither of the web frameworks are to be replaced by the other, nor there are plans to have them merged.<br />There are other vendors that offer 3rd party components and controls, like Telerik or Devexpress. These controls get rid of most of the quot;
boilerplatequot;
 code that you would be writing, so they are feasible for small applications. But when it comes to building complex enterprise applications, you would notice that these 3rd party components do not cover all of the uses cases that you need, so ASP.MVC would be a safer bet.<br />Conclusion<br />All mentioned above prove that MVC 3 is very reliable and can easily be used to develop complex web applications in a very short time, with great elegance. It is easy to start with at a beginner level, allowing you to build basic functionality without too much experience, and allowing more advanced developers to build solid, complex applications in a short time. When working on a project you have to take into consideration it's purpose, scale, scalability and maintainability, and choose a framework accordingly. Even if lately Microsoft has integrated more and more RAD components into ASP.MVC, this framework is still designed for complex web application.<br />
ASP.NET MVC3 RAD
ASP.NET MVC3 RAD
ASP.NET MVC3 RAD
ASP.NET MVC3 RAD

More Related Content

What's hot

Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
Rich Helton
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
Lee Englestone
 
Code Camp 06 Model View Presenter Architecture
Code Camp 06   Model View Presenter ArchitectureCode Camp 06   Model View Presenter Architecture
Code Camp 06 Model View Presenter Architecture
bitburner93
 
Murach: How to transfer data from controllers
Murach: How to transfer data from controllersMurach: How to transfer data from controllers
Murach: How to transfer data from controllers
MahmoudOHassouna
 
Part 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicePart 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicekrishmdkk
 
Knockout in action
Knockout in actionKnockout in action
Knockout in action
Gerardo Leyes
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
Lee Englestone
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-Binder
Simon Massey
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CStutorialsruby
 
Creating Workflows Windows Share Point Services
Creating Workflows Windows Share Point ServicesCreating Workflows Windows Share Point Services
Creating Workflows Windows Share Point ServicesLiquidHub
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End
祁源 朱
 
Part 2 generating a client_from_wsdl
Part 2 generating a client_from_wsdlPart 2 generating a client_from_wsdl
Part 2 generating a client_from_wsdlkrishmdkk
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Servicebutest
 
IMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to TavernaIMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT Centre of Competence
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universitylhkslkdh89009
 
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Akhil Mittal
 

What's hot (19)

Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
 
Code Camp 06 Model View Presenter Architecture
Code Camp 06   Model View Presenter ArchitectureCode Camp 06   Model View Presenter Architecture
Code Camp 06 Model View Presenter Architecture
 
Murach: How to transfer data from controllers
Murach: How to transfer data from controllersMurach: How to transfer data from controllers
Murach: How to transfer data from controllers
 
Part 1 implementing a simple_web_service
Part 1 implementing a simple_web_servicePart 1 implementing a simple_web_service
Part 1 implementing a simple_web_service
 
Knockout in action
Knockout in actionKnockout in action
Knockout in action
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-Binder
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CS
 
Creating Workflows Windows Share Point Services
Creating Workflows Windows Share Point ServicesCreating Workflows Windows Share Point Services
Creating Workflows Windows Share Point Services
 
當ZK遇見Front-End
當ZK遇見Front-End當ZK遇見Front-End
當ZK遇見Front-End
 
Part 2 generating a client_from_wsdl
Part 2 generating a client_from_wsdlPart 2 generating a client_from_wsdl
Part 2 generating a client_from_wsdl
 
JAX 08 - Agile RCP
JAX 08 - Agile RCPJAX 08 - Agile RCP
JAX 08 - Agile RCP
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
 
Test
TestTest
Test
 
IMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to TavernaIMPACT/myGrid Hackathon - Introduction to Taverna
IMPACT/myGrid Hackathon - Introduction to Taverna
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry university
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...Enterprise Level Application Architecture with Web APIs using Entity Framewor...
Enterprise Level Application Architecture with Web APIs using Entity Framewor...
 

Similar to ASP.NET MVC3 RAD

Generic Repository Pattern in MVC3 Application with Entity Framework
Generic Repository Pattern in MVC3 Application with Entity FrameworkGeneric Repository Pattern in MVC3 Application with Entity Framework
Generic Repository Pattern in MVC3 Application with Entity FrameworkAkhil Mittal
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
Suzanne Simmons
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
MahmoudOHassouna
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
Toushik Paul
 
Adding a view
Adding a viewAdding a view
Adding a viewNhan Do
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
Alicia Buske
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To Umbraco
Ken Cenerelli
 
Mvp pattern
Mvp patternMvp pattern
Mvp pattern
Khuong Vo
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
Naveen Kumar Veligeti
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
Anton Krasnoshchok
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
Rich Helton
 
A Brief Note On Asp.Net And Cloud Computing Essay
A Brief Note On Asp.Net And Cloud Computing EssayA Brief Note On Asp.Net And Cloud Computing Essay
A Brief Note On Asp.Net And Cloud Computing Essay
Lanate Drummond
 
5a329780735625624 ch10
5a329780735625624 ch105a329780735625624 ch10
5a329780735625624 ch10harkesh singh
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference Sheet
GoodCustomers
 
Learning .NET Attributes
Learning .NET AttributesLearning .NET Attributes
Learning .NET Attributes
Pooja Gaikwad
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
sonia merchant
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
IRJET Journal
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
ssusere19c741
 
Struts 1
Struts 1Struts 1
Struts 1
Lalit Garg
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
Flavius-Radu Demian
 

Similar to ASP.NET MVC3 RAD (20)

Generic Repository Pattern in MVC3 Application with Entity Framework
Generic Repository Pattern in MVC3 Application with Entity FrameworkGeneric Repository Pattern in MVC3 Application with Entity Framework
Generic Repository Pattern in MVC3 Application with Entity Framework
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
 
Adding a view
Adding a viewAdding a view
Adding a view
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To Umbraco
 
Mvp pattern
Mvp patternMvp pattern
Mvp pattern
 
Why use .net by naveen kumar veligeti
Why use .net by naveen kumar veligetiWhy use .net by naveen kumar veligeti
Why use .net by naveen kumar veligeti
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
A Brief Note On Asp.Net And Cloud Computing Essay
A Brief Note On Asp.Net And Cloud Computing EssayA Brief Note On Asp.Net And Cloud Computing Essay
A Brief Note On Asp.Net And Cloud Computing Essay
 
5a329780735625624 ch10
5a329780735625624 ch105a329780735625624 ch10
5a329780735625624 ch10
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference Sheet
 
Learning .NET Attributes
Learning .NET AttributesLearning .NET Attributes
Learning .NET Attributes
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
 
Struts 1
Struts 1Struts 1
Struts 1
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 

Recently uploaded

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

ASP.NET MVC3 RAD

  • 1. ASP.NET MVC 3 Rapid Application Development<br />Mădălin Ștefîrcă and Victor Chircu<br />Abstract. This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 using Microsoft Visual Studio 2010. It will describe why creating a new web application using Mvc 3 is a lot easier and faster and also present simple ways to develop such applications.<br />Introduction<br />The paper will describe to you the simplicity of developing a web application using Microsoft’s ASP.NET MVC3. Starting with the creation of a new project, adding new items, and quickly adding functionality including modeling, databases CRUD operations, UI elements etc. There will be a brief presentation of the Html Helpers provided by Visual Studio, and the use of Dynamic Templates and how they can help you and a comparison between MVC 3 and Web Forms, the main web oriented frameworks provided by Microsoft.<br />Creating a new project<br />Creating a new project is easier than ever. You can create an emtpy project allowing you to structure it the way you think is best fit, or you can choose to create a new Internet Application that will create for you a fully functioning project and fully extensible. It is recommended to choose the second option, because this way you will not have to worry about the project structure and start developing since the very first minute. If you watch Fig.1 you can notice that Visual Studio has buit for you separate folders for Controllers, Views, Models, Scripts, Content. <br />If you check the packages.config file you can also see that Visula Studio also added some useful packages for you like jQuery, jQuery-UI, jQuery.Validation meaning javascript libraries that will greatly improve your development and are very common to an experienced developer. The Entity Framework nuGet package is installed also by default and it comes in handy when working with complex databases since most of the work is done by this ORM (Object Relational Mapping tool ).<br />In the Viewshared folder you will find two .cshtml files, _Layout, used as a master page in the application, and Error, used as an global error page displayed to the user when the server crashes. These two are also added by default when creating a new MVC3 project. <br />If you run the application you will notice that you have a fully functional project including a minimal authentication system that allows you to register users and authenticate them later on.<br />Fig. SEQ quot; Figurequot; MERGEFORMAT 1. <br />Adding new items<br />Models<br />Visual Studio also has provided for you an easy way for adding new items to your projects. You can add a new class in the Models folder that will be our new model. Right click the Models folder and select Add/Class. Name the class Employee and click Add. Inside the class you type “prop” and click the Tab key. This will instantly create for you a default property. Pressing the Tab key will switch you through the property type and property name in order to change them. Make for a start two properties of type string and name them Name and CompanyName and an Id. Still inside the class, if you type in “ctor” and press Tab key it will automatically generate a constructor for you. Inside the constructor assign the CompanyName property a string. Now you have your first model. Your code should look like this:<br />public class Employee<br /> {<br /> public Employee()<br /> {<br /> this.CompanyName = quot; Fictional Companyquot; ;<br /> }<br />public int Id { get; set; }<br /> public string Name { get; set; }<br /> public string CompanyName { get; set; }<br /> }<br />Context<br />Now we will have to add a context for Entity Framework database. Int he Models folder add a new class. This should inherit the DBContext object from System.Data.Entity. Add a property to the class that should look like this:<br />public class EmployeeContext : DbContext<br /> {<br /> public DbSet<Employee> Employees { get; set; }<br /> }<br />And now you have your context.<br />Controllers<br />To add a new controller, you simply right click the Controllers folder and select Add/Controller. You type in the controller name, and then you get to choose between several scaffolding options like and empty controller, controller with empty actions or controller with read/write actions and views. The latter is the easiest way to develop. Choosing this option will require you to set the model class and the data context. Our model is Employee and context is EmployeeeContext. After selecting those previously mentioned click Add. This will generate you the whole mechanism required for CRUD (Create, Read, Update, Delete) operations over the Employee entity, including database operations, and UI. If you take a look in the Views/Employees folder you will see that Visual Studio has already generated all the html you need for the actions. If you run the application in your browser and go to host/Employees you will have the full functionality done.<br />Html helpers<br />Html Helpers are provided by visual studio as support for rendering HTML controls in a view. It has a wide variety of choices like generating a link, forms, or even inputs or validations for inputs based on a predefined model. Also these helpers are highly extensible, customizing them being a great benefit for development.<br />@Html.EditorFor(m => m.Property)<br />@Html.DropDownListFor(m => m.Property, customSelectList)<br />Dynamic templates<br />Templates are used to display a predetermined portion of the page layout which also contains fill-in-the-blanks that can be filled at run time. Template saves a lot of time because it can be reused in many places. Razor view engine includes a feature called Inline Template which allows you to define a portion of dynamic HTML that can be reused. Also using Razor template you can pass template as a parameter to a method.<br />You can make this for display or edit mode. All you must do is to set the @model of the template to the desired type. This can be a struct, a class, or even a collection. You can call this templates either by setting the name of the templates exactly the same as the type of the property of the model, or by setting an attribute to the property [UIHint(“templateName”)].<br />Alternatives<br />The main advantages of the ASP.NET MVC 3 are that it enables full control over the rendered HTML, it provides clean separation of concerns, easy integration with javascript, RESTful urls that enables SEO, no ViewState and PostBacks events. The web forms provide a wide variety of RAD elements, like drag & drop, automatic event generation, and it is easier for developers coming from the winform development to adapt. Another big plus for the web forms framework is the maturity - it has been around since 2002 and there is a big amount of information regarding solving problems. Both of them are good choices, neither of the web frameworks are to be replaced by the other, nor there are plans to have them merged.<br />There are other vendors that offer 3rd party components and controls, like Telerik or Devexpress. These controls get rid of most of the quot; boilerplatequot; code that you would be writing, so they are feasible for small applications. But when it comes to building complex enterprise applications, you would notice that these 3rd party components do not cover all of the uses cases that you need, so ASP.MVC would be a safer bet.<br />Conclusion<br />All mentioned above prove that MVC 3 is very reliable and can easily be used to develop complex web applications in a very short time, with great elegance. It is easy to start with at a beginner level, allowing you to build basic functionality without too much experience, and allowing more advanced developers to build solid, complex applications in a short time. When working on a project you have to take into consideration it's purpose, scale, scalability and maintainability, and choose a framework accordingly. Even if lately Microsoft has integrated more and more RAD components into ASP.MVC, this framework is still designed for complex web application.<br />