Вы находитесь на странице: 1из 7

Difference between ViewData,ViewBag and TempData in MVC 3.0 Difference between ViewData,ViewBag and TempData in MVC 3.

0 ViewData ViewData is a dictionary of objects that are accessible using strings as keys ViewBag ViewBag uses the dynamic feature that was added in to C# 4.0 It allows an object to dynamically have properties added to it. We can say ViewBag=ViewData + dynamic wrapper around the ViewData dictionary. TempData Temp data use during the current and subsequent request only means it is use when you are sure that next request will be redirecting to next view.

Example for ViewData: ViewData[JustLearn]=Just Learn on http://www.asp.net/ is rock!! Example for ViewBag: ViewBag.JustLearn =Just Learn on http://www.asp.net/ is rock!! Example for TempData: TempData[JustLearn]=Just Learn on http://www.asp.net/ is rock!! Reference: http://onlydifferencefaqs.blogspot.in/2012/08/difference-betweenviewdataviewbag-and.html MVC 2 vs MVC 3 in ASP.NET Difference between MVC 2 and MVC 3 in ASP.NET S.No 1 MVC 2 MVC 3

View Engines: View Engines: MVC 2 uses only Web Forms The view engines used in the view engine (.aspx). ASP.NET MVC 3 Framework are the Razor View Engine (.cshtml or .vbhtml) and the Web Forms view engine (.aspx). Chart, WebGrid, WebImage, Chart, WebGrid, WebMail Controls: WebMail Controls: Not Available Available Objects available for sharing data between View and Controller: TempData, ViewData Web Forms view WebImage,

Objects available for sharing data between View and Controller: TempData, ViewData ,ViewBag

engine Razor View Engine syntax:

syntax: <%=Html code %> 5 6 Support for jQuery: Good Support for Injection: Good

@Html code Support for jQuery: Better for Dependency

Dependency Support Injection: Better

Support of Layouts: Only Master Page (.master)

Support of Layouts: Both Master Page (.master) and Layout Page (_Layout.cshtml)

Note: Master pages are the same if we are using the .aspx view engine. If we are using Razor, then it's the Layout page. Reference: http://onlydifferencefaqs.blogspot.in/2012/09/difference-between-mvc-2-andmvc-3-in.html Grails 2.0 vs ASP.NET MVC 4.0 Difference between Grails 2.0 and ASP.NET MVC 4 S.No 1 Grails 2.0 Meaning: Grails is an open source web application framework which uses the Groovy programming language (which is in turn based on the Java platform). It is intended to be a highproductivity framework by following the "coding by convention" paradigm, providing a stand-alone development environment and hiding much of the configuration detail from the developer. ASP.NET MVC 4.0 Meaning: The ASP.NET MVC Framework is a web application framework that implements the model-viewcontroller (MVC) pattern. Based on ASP.NET, it allows software developers to build a Web application as a composition of three roles: Model, View and Controller. A model represents the state of a particular aspect of the application. A controller handles interactions and updates the model to reflect a change in state of the application, and then passes information to the view. A view accepts necessary information from the controller and renders a user interface to display that. Community Support: Yes. MVC 4 may be built on .NET

Community Support: No. Grails is built on Groovy

which is a dynamic language that compiles into byte-code that runs on the Java virtual machine. Unfortunately, the number of Groovy developers in the world are far outnumbered by the number of C, C++, VB, C#, and Java developers. 3 Cost of Development: Yes. Grails is much cheaper to develop and deploy. It is conceivable that the cost of development and deployment is free since it can be done with open source tools and platforms.

VB or .NET C#. The usage of C# seems to be growing versus VB according to indeed.com job trends. Therefore, in the comparison with Grails, this comparison is focused on MVC 4 .NET C#. The C# open source community is very large. It is not quite the size of Java or C/C++, but it is global. Cost of Development: No. The cost of development is basically free if Visual Studio 2011 Express is considered sufficient (Note: In this case Visual Studio Professional is used). The cost of deployment is likely more than zero...it depends on the amount of data that is required to be stored and the number of users that would be connecting. OS knowledge required or not ? No. The .NET framework is affected by system updates to the Windows operating system. While it is possible to separate the .NET specific updates from the rest of the operating system updates, that is a hassle. Also, due to the success of the .NET framework for Microsoft over past ten years, it has become more intertwined with the operating system. As a result, it is not always clear where .NET begins and and the operating system ends. Therefore, at the very least, ASP.NET MVC 4 requires Windows operating system knowledge and research for each patch deployment...that is an ongoing cost that is arguably greater than that of maintaining a JVM.

OS knowledge required or not ? Yes. Since Grails runs in a JVM, there is little to no relationship between the JVM and the operating system.

Reference: http://onlydifferencefaqs.blogspot.in/2012/09/grails-20-vs-aspnet-mvc-40.html

Spring vs ASP.NET MVC Difference between Spring and ASP.NET MVC S.No 1 Spring Meaning: The Spring Framework is an open source application framework and Inversion of Control container for the Java platform. ASP.NET MVC Meaning: The ASP.NET MVC Framework is a web application framework that implements the model-viewcontroller (MVC) pattern. Based on ASP.NET, it allows software developers to build a Web application as a composition of three roles: Model, View and Controller. A model represents the state of a particular aspect of the application. A controller handles interactions and updates the model to reflect a change in state of the application, and then passes information to the view. A view accepts necessary information from the controller and renders a user interface to display that. 2 3 4 5 Global Preference: 12% Official Website: www.springsource.org License: Apache License,GPL2 Development Principles: Convention over configuration Design pattern: Dependency injection Operating system: Cross-platform Programming language: Java Database: MSSQL Global Preference: 67% Official Website: http://asp.net/mvc License: Proprietary Development Principles: Convention over configuration,Testdriven development Design pattern: Active-Record,Model-ViewController,Dependency injection Operating system: Windows Programming language: C#, JavaScript,VB.NET,F# Database: MSSQL

7 8 9

MySQL PostgreSQL Oracle SQLite IBM DB2 JDBC Compatible MongoDB Microsoft SQL Server 2005 Teradata Cassandra 10 Template language: JSP JSTL HTML5 Velocity Target audience: Enterprise Difficulty level: Intermediate Advanced Programming paradigm: Aspect-oriented programming Scripting language support: Groovy JavaScript PHP Ruby Object-Relational Mapping: Hibernate, iBatis, more Testing Framework(s): Mock objects, unit tests DB Migration Framework(s): N/A Security Framework(s): Spring Security (formerly Acegi) Form Validation Framework(s): Commons validator, Bean Validation

MySQL Oracle SQLite PostgreSQL IBM DB2

Template language: RazorEngine ASPX

11 12

Target audience: Enterprise,SMB Difficulty level: Beginner Intermediate Advanced Programming paradigm: Object-oriented Scripting language support: JavaScript

13 14

15 16

Object-Relational Mapping: ORM-independent Testing Framework(s): Unit tests, Functional Tests, Integration Tests DB Migration Framework(s): Entity Framework Security Framework(s): ASP.NET Forms Authentication (Default), Pluggable Form Validation Framework(s): Yes (client-side via plugins)

17 18

19

Reference: http://onlydifferencefaqs.blogspot.in/2012/09/spring-vs-aspnet-mvc.html

Ruby on Rails vs ASP.NET MVC Difference between Ruby on Rails and ASP.NET MVC S.No 1 Ruby on Rails Meaning: Ruby on Rails, often shortened to Rails, is an open source full-stack web application framework for the Ruby programming language. Rails is a full-stack framework, meaning that it gives the web developer the ability to gather information from the web server, talk to or query the database, and render templates out of the box. As a result, Rails features a routing system that is independent of the web server. Ruby on Rails emphasize the use of well-known software engineering patterns and principles, as Active record pattern, Convention over Configuration, Don't Repeat Yourself and Model-ViewController. Note: Ruby on Rails is not to be confused with Ruby, which is a general-purpose programming language, on which Ruby on Rails runs. Ruby itself existed for more than 10 years before the first release of Ruby on Rails. Global Preference: 25% Official Website: http://rubyonrails.org License: MIT License Design pattern: Active-Record,Model-ViewController Operating system: ASP.NET MVC Meaning: The ASP.NET MVC Framework is a web application framework that implements the model-viewcontroller (MVC) pattern. Based on ASP.NET, it allows software developers to build a Web application as a composition of three roles: Model, View and Controller. A model represents the state of a particular aspect of the application. A controller handles interactions and updates the model to reflect a change in state of the application, and then passes information to the view. A view accepts necessary information from the controller and renders a user interface to display that.

2 3 4 6

Global Preference: 67% Official Website: http://asp.net/mvc License: Proprietary Design pattern: Active-Record,Model-ViewController,Dependency injection Operating system:

Linux Mac OS X Windows QNX 8 9 Programming language: Ruby Database: MSSQL MongoDB MySQL PostgreSQL Drizzle Oracle Redis SQLite Template language: ERB HAML Erubis Radius Target audience: Enterprise Web Development Difficulty level: Beginner

Windows

Programming language: C#, JavaScript,VB.NET,F# Database: MSSQL MySQL Oracle SQLite PostgreSQL IBM DB2

10

Template language: RazorEngine ASPX

11

Target audience: Enterprise,SMB Difficulty level: Beginner Intermediate Advanced API: Good Scripting language support: JavaScript

12

13 14

API: Basic Scripting language support: Ruby JavaScript coffeescript Object-Relational Mapping: ActiveRecord Security Framework(s): Plug-in

15 16

Object-Relational Mapping: ORM-independent Security Framework(s): ASP.NET Forms Authentication (Default), Pluggable

Reference: http://onlydifferencefaqs.blogspot.in/2012/09/ruby-on-rails-vs-aspnet-mvc.html

Вам также может понравиться