Sie sind auf Seite 1von 5

ASP.

NET Web Forms

ASP.NET MVC

ASP.NET MVC uses Front


ASP.NET Web Forms use Page controller pattern
Controller approach. That
approach for rendering layout. In this approach,
approach means a common
every page has its own controller, i.e., codecontroller
for
all
pages
behind file that processes the request.
processes the requests.
No separation of concerns. As we discussed that
every page (.aspx) has its own controller (code
behind i.e. aspx.cs/.vb file), so both are tightly
coupled.

Very clean
concerns.
Controller
separate.

separation of
View
and
are
neatly

Testability is a key feature in


Because of this coupled behavior, automated ASP.NET MVC. Test driven
testing is really difficult.
development is quite simple
using this approach.
In order to achieve stateful behavior, viewstate
is used. Purpose was to give developers the
same experience of a typical WinForms
application.

ASP.NET MVC approach is


stateless as that of the web.
So there is no concept of
viewstate.

Statefulness has a lots of problem for web


environment in case of excessively large
viewstate. Large viewstate means increase in
page size.

As controller and view are


not dependent and also no
viewstate concept in ASP.NET
MVC, so output is very clean.

No Page Life cycle like


ASP.NET WebForms model follows a Page Life WebForms. Request cycle is
cycle.
simple in ASP.NET MVC
model.
Along with statefulness, Microsoft tries to
introduce server-side controls as in Windows
In MVC, detailed knowledge
applications. Purpose was to provide somehow
of HTML, JavaScript and CSS
an abstraction to the details of HTML. In ASP.NET
is required.
Web Forms, minimal knowledge of HTML,
JavaScript and CSS is required.
The above abstraction was good but provides
Full control over
limited control over HTML, JavaScript and CSS
JavaScript and CSS.
which is necessary in many cases.

HTML,

With a lots of control libraries availability and


It's
a
step
back.
limited knowledge of other related technologies,
developers
decrease
ASP.NET WebForms is RAD(Rapid Application
productivity.
Development) approach.

For
in

Its
better
as
well
as
recommended approach for
Its good for small scale applications with limited
large-scale
applications
team size.
where different teams are
working together.

Feature/Criteri

Windows Forms

Web Forms

on

Deployment

Windows Forms allows "notouch"


deployment
with
ClickOnce, where applications
can be downloaded, installed,
and run directly on the users'
computers
without
any
alteration of the registry. For
more
information
about
ClickOnce,
see ClickOnce
Deployment Overview.

Web Forms has no client


deployment; the client
requires only a browser.
The server must be
running the Microsoft
.NET
Framework.
Updates
to
the
application are made by
updating code on the
server.

Graphics

Windows Forms includes GDI+,


which enables sophisticated
graphics for games and other
extremely
rich
graphical
environments.

Interactive or dynamic
graphics requires round
trips to the server for
updates when used on
Web Forms. GDI+ can
be used on the server to
create custom graphics.

Responsiveness

Windows Forms can run entirely


on the client computer; It can
provide the quickest response
speed for applications requiring
a high degree of interactivity.

If you know that users


will
have
Internet
Explorer 5 or later, a
Web Forms application
can use the browser's
dynamic HTML (DHTML)
capabilities to create a
rich, responsive user
interface (UI). If users
have other browsers,
most
processing
(including
UI-related
tasks
such
as
validation) requires a
round trip to the Web
server, which can affect
responsiveness.

Form and text


flow control

Windows Forms grid positioning


gives
you
precise
twodimensional control (x and y
coordinates)
over
the
placement of controls.
To display text on Windows
Forms, you insert the text into
controls
(for
example,
the Label control,

Web Forms is based on


HTML-style flow layout
and therefore supports
all the features of Web
page
layout.
It
is
particularly rich in text
formatting support.
Control layout can be
managed
adequately

the TextBox control,


the RichTextBox control).
Formatting is limited.

or

(with some limitations,


such as no overlapping
controls). If the users
have
DHTML-capable
browsers,
you
can
specify
much
more
precise layout with twodimensional (x- and ycoordinate) layout.

Platform

Windows Forms requires the


.NET Framework running on the
client computer.

Web
Forms
requires
only a browser. DHTMLcapable browsers can
use extra features, but
Web Forms can be
designed to work with
all browsers. The Web
server must be running
the .NET Framework.

Access to local
resources
(file
system,
Windows
registry, and so
on)

Applications, when permitted,


can have complete access to
local computer resources. If
required, the application, with
precision, can be restricted
from using specific resources.

Browser
security
prevents the application
from
accessing
resources on the local
computer.

Programming
model

Windows Forms is based on a


client-side, Win32 messagepump mode, where instances
of components are created,
used, and discarded by the
developer.

Web Forms relies on a


largely
asynchronous,
disconnected
model,
where components are
loosely coupled to the
application front end.
Typically,
application
components are invoked
through
HTTP.
This
model may not be
suitable for applications
requiring
extreme
throughput from the
user end or for those
with
high-volume
transactions. Similarly,
Web Forms applications
may not be suitable for
database
applications
that require high levels
of concurrency control
(for
example,

pessimistic locking).
Security

Windows
Forms
uses
permissions
in
its
implementation of code access
security to protect computer
resources
and
sensitive
information. This allows careful
exposure of functionality, while
retaining security. For instance,
the Printing Permission, which
at one level would allow
printing to the default printer
only, at another level would
allow printing to any printer.
Using ClickOnce, developers
can easily configure which
permissions their applications
should and should not demand
from the client. For more
information,
see ClickOnce
Deployment and Security.

Authorization to gain
access to the resources
of a Web application is
typically controlled on a
per-URL
basis
by
authenticating
the
credentials
(for
example,
a
name/password pair) of
the
requestor.
Web
Forms
allows
the
developer to control the
identity under which
server application code
is
executed.
Applications
can
execute code with the
identity
of
the
requesting entity, which
is
known
as
impersonation.
Applications can also
dynamically
tailor
content based on the
requestor's identity or
role. For example, a
manager could receive
access to a site, or a
higher level of content
than
someone
with
lower permissions.

Feature/Creation
Windows Forms
ASP.NET Web Application
User Interfaces, data Easy to build
Difficult to build
binding etc.
Deployment
and Complex.
New
versions
ofEasy. Need to deploy assemblies
Maintenance
assemblies, configuration files,and configuration files on the server
and other required files must beonly. Transparent to the client.
deployed on all client machines.
Usually user interaction required.
Performance
Faster
Slower
Robustness
and One client machine goes down,Usually web servers are never down.
Reliability
other users are still live.
However if the server goes down, all
users are affected.
Network Congestion
Depending on the data transfer Depends
and connections made to the
server from various clients.
Resources
Runs on the client machine.
Runs on a Web server.
Catastrophic failure
User interaction required.
Usually user interaction
not
required.
Framework
All client machines have to installOnly server needs to have .NET
dependency
required
versions
of
.NETframework and other required
framework and other requiredlibraries.
libraries.

Das könnte Ihnen auch gefallen