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

Collaborate

Knowledge Byte
• In this section, you will learn to:

• Migrate from ASP to ASP.NET


• Implement Code Access Security (CAS)

©NIIT Collaborate Lesson 4C / Slide 1 of 18


Collaborate

Migration from ASP to ASP.NET


• The success of the migration process depends on two key factors:
• Handling issues that arise during the migration process
• Strategy used to migrate an application

©NIIT Collaborate Lesson 4C / Slide 2 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• The various migration issues that arise while migrating an ASP application to
ASP.NET are:
• Presentation layer issues:
• Signify the different issues encountered while migrating the user
interface (UI) of an application.
• Business layer issues:
• Signify the different issues encountered while changing the way in
which the business logic is implemented
• Data access layer issues:
• Signify the different issues encountered while migrating from ADO to
ADO.NET

©NIIT Collaborate Lesson 4C / Slide 3 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• Some of the key issues that arise while migrating presentation layerare:
• Configuration architecture: In ASP.NET, all the configuration information
about an application is stored inside the Web.config file and saved in the
root directory of the application.
• State management: The state management method used in the ASP
application can be preserved while migrating the application to ASP.NET.
• Intrinsic objects: The implementation of most of the intrinsic objects, such
as Response and Request, has changed in ASP.NET.
• Code structure: This is one area where there is a major shift between ASP
and ASP.NET.

©NIIT Collaborate Lesson 4C / Slide 4 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• Some of the key business layer issues are:
• In ASP, most of the logic is implemented using COM components.
For this reason, the major issue while migrating the business layer of
the ASP application to ASP.NET is managing COM components.
• Some of the key data access layer issues are:
• The key focus of migration of the data access layer is migrating from
ADO to ADO.NET.

©NIIT Collaborate Lesson 4C / Slide 5 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• In most cases, the applications to be migrated are critical, complex, and large, so
single-step migration strategies do not work. For this reason, a phase-by-phase
migration is applied.
• There are two strategies for implementing a phase-by-phase migration. They are:
• Horizontal migration:
• Migration is performed on a layer-by-layer basis
• Each layer of an application is migrated one after another
• Vertical migration:
• Application is broken down into different isolated units
• Migration is performed on a unit-by-unit basis.

©NIIT Collaborate Lesson 4C / Slide 6 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• The designing of a migration strategy includes the following processes:
• Requirement analysis:
• An application is migrated to a newer technology only when the
current technology fails to meet the new requirements.
• Architecture analysis of the application:
• The architecture of the application has to be analyzed to estimate the
amount of work required to migrate the application.
• Design a migration plan:
• The focus of this process is to do a low-level analysis of the
application

©NIIT Collaborate Lesson 4C / Slide 7 of 18


Collaborate

Migration from ASP to ASP.NET


(Contd.)
• Implementing Phase-By-Phase Migration:
• During the phase-by-phase migration of an ASP application, one key
hurdle is achieving interoperability between the migrated and nonmigrated
components of the application.
• The interoperability issues depend on the migration strategy you have
adopted.
• Interoperability Issues in Horizontal Migration
• Interoperability Issues in Vertical Migration

©NIIT Collaborate Lesson 4C / Slide 8 of 18


Collaborate

Code Access Security


• Code Access Security (CAS) is a new security feature introduced by Microsoft. CAS
is implement on a concept called evidence-based security. Evidence is the set of
information used by the CLR to identify an assembly.
• There are three key elements on which the CAS feature is implemented:
• Permission
• Security policy model
• Evidence

©NIIT Collaborate Lesson 4C / Slide 9 of 18


Collaborate

Code Access Security (Contd.)


• Permissions:
• Are rules that administer how an assembly can access a restricted
resource and what operations can be performed on a restricted resource.
• Will be either grant access or deny access
• Can be grouped into a permission set
• Can be linked to a code group to control their actions

©NIIT Collaborate Lesson 4C / Slide 10 of 18


Collaborate

Code Access Security (Contd.)


• Security Policy Model has the following characteristics:
• Security setting that a policy implements (Permission Set).
• Level at which these security settings will be applied (Security Policy-
Level). The following table lists policy-levels and their description:

Policy-Level Description

Enterprise The security policy defined at this level is applied to


every code running in the enterprise domain.
Machine The security policy defined at this level is applied to
every code running on the machine.
User The security policy defined at this level is applied to
every code executed by the current operating system
user.
Application domain The security policy defined at this level is applied to
every code executing within an application.

©NIIT Collaborate Lesson 4C / Slide 11 of 18


Collaborate

Code Access Security (Contd.)


• Evidence:
• Evidence can be called as the identity card of an assembly.
• The following table lists the five types of evidence:
Evidence Type Description

Zone Specifies the security zone, such as MyComputer and the


Internet from which the code originated.
URL Specifies the URL from which the code originated.
Site Specifies the Web site from which the code originated.
Strong Name Specifies the digital signature associated with the
assembly.
Hash Specifies the hash value of the assembly.

©NIIT Collaborate Lesson 4C / Slide 12 of 18


Collaborate

From the Expert’s Desk


• This section will introduce the following:

• Best practice on optimizing state management


• Tips
• FAQs

©NIIT Collaborate Lesson 4C / Slide 13 of 18


Collaborate

Best Practices
Optimizing State Management
• The best practices that should be followed while designing state management:
• The Application object that stores the application-level information
should be replaced with static properties.
• The session state should be disabled in all the pages that do not require
per-user session state. You can set the value of the
EnableSessionState attribute of the page directive to false to disable
the per-user session for a page. The value of EnableSessionState
should be set to read-only on the pages that only access session
variables but do not modify or create them.
• The Viewstate should be disabled at the application level. Set the value
of the enableViewState attribute of the <page> tag to false. Enable
the Viewstate on pages where it is required. Set the value of the
EnableViewState attribute of the page directive to true to enable the
Viewstate.
• Minimize the number of objects that are stored in the Viewstate.
©NIIT Collaborate Lesson 4C / Slide 14 of 18
Collaborate

FAQs
• Can I use the in-process state management option over a Web farm?
• Yes, as different servers furnish requests from a single user, it impossible
to mange the session state under normal settings. You can configure the
Application Center to force one sever to furnish all the requests from a
specific client. This feature is called sticky IP.

• Can I change the default port used while using the stateserver option for
session state management?
• Yes, you can change the default port by editing the value stored in the
HKLM\SYSTEM\CurrentControlSet\Services\aspnet_state key in
the system registry.

©NIIT Collaborate Lesson 4C / Slide 15 of 18


Collaborate

FAQs (Contd.)
• How can I configure my SQL Server to implement session management with
SQL Server?
• To use SQL Server for session state management, you must create the
ASPState database on the SQL Server. You can create the ASPState
database by running InstallState.sql script. This script can be located at
the following location:
%WinDi%r\Microsoft.Net\Framework\Version
Where, Version refers to the version of .Net Framework installed on your
computer.

• My ASP.NET page has a datagrid that is bound to a large database. Can I apply
caching to improve the performance of this page?
• Yes, the best strategy is to implement fragment caching. You should first
create a user control that will include this DataGrid control and then apply
the fragment cache on this user control.

©NIIT Collaborate Lesson 4C / Slide 16 of 18


Collaborate

Challenges
• Your company, BlueMoon Solution Inc., is developing an Online Book Store
application for NewTechBookStore. As a member of the development team,
you are aware of the application requirement. One of the modules you are
working on uses two tables, BookCategories and BookItems. The module
only displays the data in the BookCategories table and does not perform any
modification. The BookItems table is updated in this module. You want to
optimize this module to improve the response time of this page. What
should you do?
a. Store the BookItems table in a session variable and cache the
BookCategories table. FETCH
b. Store the BookCategories table in a session variable and cache the
BookItems
c. Store both the tables in two separate session variables.
d. Cache both the tables.

©NIIT Collaborate Lesson 4C / Slide 17 of 18


Collaborate

Solutions
1. a. Store the BookItems table in a session variable and cache the
BookCategories table.

©NIIT Collaborate Lesson 4C / Slide 18 of 18

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