10th Lecture: Using. NET to develop large-scale enterprise-level applications

Source: Internet
Author: User
Tags asp net knowledge base

2005.2.22 ou yanliang

Basic Content

Familiar with Microsoft. NET

Object-Oriented Programming in. NET

Microsoft ADO. NET

 

Course Introduction

How to develop enterprise-level applications

 

Course Arrangement

Componentization Design

Multi-layer application design

Intermediate layer concept

Distributed Application Design

Team Development

Integration

 

Componentized Program Design

Objectives:

Create reusable components

Reuse existing components to shorten development time

Build consistent component concepts

Develop a component Policy

Patterns and Practices

Develop a design-review plan

Create a knowledge base

Training knowledge base for team members

Motivate team members to maintain knowledge base content

 

Multi-tier application architecture

In order to reuse, modularize, and maintain, we recommend that you divide the application code into loosely coupled hierarchies based on the Program Logic.

Typical layer-3 logic architecture

Presentation Layer

Business logic layer

Data access layer (data storage layer)

Deploy different logical layers to multiple physical layers to achieve deployment scalability

Typical layer-3 physical architecture

Presentation Layer-UI, such as WinForms or ASP. NET pages

Intermediate layer-business logic component, generally running in the host environment

Data access layer-high-performance, concurrent RDBMS, such as Microsoft SQL Server

 

Layer-3 physical architecture

 

Data transmission between physical layers

Data must be encapsulated before being transferred between multiple layers.

There are several options for encapsulating data

DataSet-the simplest way

XML

Custom object-the most efficient

Which encapsulation method should be selected based on local conditions?

 

Demonstration 1

Layered application architecture

 

Business logic layer

The business logic layer may change frequently. in order to isolate the changes, we add a LogicFacade class as the front-end interface of the logic layer to help the presentation layer access the logic layer. Therefore, when the content of the logic layer changes, we do not need to re-compile the project of the presentation layer.

The presentation layer calls the Facade interface instead of calling the logic layer directly.

 

Options for the physical Middle Layer

Running components of the business logic layer in the host environment

Web Service and System. Web namespace (simple development and low efficiency)

COM + and EnterpriseServices namespaces (high efficiency)

Remoting component and System. Runtime. Remoting namespace (complex development, higher TCP connection efficiency, and lower Http efficiency)

Scalability! = High Performance

 

Demonstration 2

Web Service

 

Add a Web Service project as the intermediate layer. The role of the Global. asax file is that IIS can initialize WebService when loading WebService, which contains some Start and End interfaces.

Its business logic is very simple. It only migrates the data access layer originally located in the presentation layer to WebService, but its interfaces remain unchanged.

The NorthwindModel specifies the data type when data is transferred between the presentation layer and the data access layer, such as some strongly-typed DataSet and some custom types.

One user in the SQL database is ASPNET. If we do not configure WebService by default, the ASP NET role is used to access the database by default. If you want the application to run normally, you need to configure the ASPNET permission in the database security policy.

In this case, the presentation layer only needs to access data through WebService and add WebService references.

Reference added

When writing our WebService, it will reference our strong-type DataSet. The client's Northwind project will automatically bring the types when referencing WebService, but these types are redundant for us because our Northwind project has referenced the NorthwindModel, therefore, we can delete DataSet from these references. Another important reason for deletion is that the namespace directly referenced by the NorthwindModel is different from the namespace referenced by the WebService.

In addition, we also need to delete the strong DataSet class in the Reference. cs file in Reference to avoid repeating the class in the NorthwindModel.

 

Service-Oriented Architecture

High scalability is an extremely important design goal when designing applications for enterprises.

Service-Oriented Architecture (SOA) requires the designer to separate the code by Hierarchy

Establish loose coupling between codes

Scalability-SOA can bring more throughput and support simultaneous processing of more concurrent requests

 

SOA considerations

You must think twice in the design phase.

Services must be designed to be state-independent.

Status management brings many problems

Interoperability design between services

Availability design

Scalability is not the same as performance

Easy to deploy

Easy to develop

Security Design

 

Distributed Application Design

Advantages and disadvantages of distributed computing coexist

Support for scaling-generally, a group of network computers must work better than a single computer unit

You can use offline models (such as Outlook)

Data concurrency may occur.

Data Buffer

Data cannot be updated in time

Concurrency conflict: Two offline users change the same record at the same time and update the record at the same time.

Security-distributed applications are more difficult to ensure data security (Signature and encryption)

Connection problems

Maintenance problems

 

Team Development

The larger the project, the more developers are needed.

Componentized development means that more developers can develop in parallel.

There is no linear relationship between resource increase and development time: double the number of developers! = Development time halved

The larger the project, the more complicated the project; the better the project management.

Using tools can reduce the complexity of work

Microsoft Visual SourceSafe-source code management

Enterprise Template)

Use SourceSafe and rely on it to work

Develop code review plan

Compliant with unified code standards

Increasing manpower and development time is not linear: increasing a developer is not equal to the development time.

Workload allocation should be determined based on the capabilities of each member.

 

SourceSafe

Check In/Check Out source code

Retain the version history of the Code (or text file) and restore it if necessary.

Add a tag to the project to get a specific version of the project.

Visual comparison file version

Files can be shared between projects.

Can be integrated into Microsoft Visual Studio. NET IDE

 

Demonstration 3

SourceSafe

 

Add solution to source code Manager

Added successfully. All files are locked on the left.

If the code is modified, the file is checked out. After the file is checked in, the lock is changed on the left of the file.

You can view the historical version of a file.

Different versions can be compared.

You can add a Label to the current project version.

You can use tags to conveniently view modifications of different versions.

 

Integrate existing systems

In many enterprises, they often use multiple operating systems, software platforms, RDBMS and workflows at the same time.

A new technology is needed to integrate them together

Businesses want to apply new technologies, but do not want to rewrite applications.

Based on different system environments, we can choose to integrate multiple methods.

 

Integration solution

Well-designed VB Applications and COM applications can be easily integrated.

Cross-platform integration can be implemented at different levels:

Database layer Integration

Integration is implemented using bridges. There are some third-party tools, such as JIntegra, Jeneva, and JCOM.

Web Service implementation integration, if the existing system is based on the ws soa Architecture

Web Service integration provides high interoperability and is loosely coupled, scalable, and available.

Enterprise Application Integration (EAI) -- Microsoft BizTalk

 

Demonstration 4

Interoperability of existing components

 

Several research topics worth attention

Patterns and Practices

Enterprise Instrumentation Framework (EIF)

Enterprise Template

Windows Services

Automated build tolls (Buildlt, NAnt)

Test-driven development (NUnit)

 

Summary

Development of large-scale applications requires more effort than development of simple applications

Developing Enterprise applications using componentized methods has many advantages.

. NET provides many functions and tools to help you simplify large-scale and complex project development.

Designing Multi-layer applications helps applications achieve reusability, scalability, and scalability.

2010.10.16

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.