Web application UML modeling and. NET Framework Development

Source: Internet
Author: User
Summary This article analyzes the architecture mode of web applications and introduces the UML extension mechanism to model various objects in Web applications. This paper discusses the UML modeling and development methods for Web applications under the. NET Framework and applies them to a practical management system. The actual application shows that this method can reduce the development complexity, shorten the development cycle, and achieve better results.

KeywordsWeb application architecture UML modeling. NET Framework lob
 
Introduction

A web-based application system consists of a server and a client browser. The server processes transactions logically, and the impact of users on the business logic on the server makes Web applications often complex and highly dynamic. This feature makes web application-Based System Development complicated and difficult to manage. To effectively solve the above problems, shorten the development cycle, and reduce maintenance costs, the main strategy is to model Web applications. UML is a unified modeling language dominant in the field of object-oriented technology. In addition ,. the Net Framework provides a complete base class library and Database Access Technology Based on the CLR for general language runtime. net and network development technology ASP. allows developers to quickly build Web applications. Therefore, this article mainly discusses based on. net Framework web application UML modeling and development method, and this method is used in the Institute management system developed by the author, the practical application shows that this method can effectively reduce the complexity of system development and management, improve economic efficiency.

Web
Application Architecture

The basic architecture of Web applications includes browsers, networks, and web servers. The browser requests a web page from the server. The web page may contain client scripts that are interpreted and executed by the browser, it can also interact with browsers, page content, and other controls contained in pages (such as Java Applet, ActiveX control, and plug-in. You can enter information on a web page or navigate to another web page through a hyperlink to interact with the system and change the "service status" of the system ".

1. Thin Web Client

It is mainly applicable to Internet-based applications and has little control over client configurations. The client only needs a standard web browser to request and display standard HTML pages. All business logic is executed on the server.

The client browser requests page resources from the server through the HTTP protocol. The server resolves the requested URL to a file in the file system, or the application server processes the request and may change the service status to obtain the requested page, return to the client.

2. Fat Web Client

Fat web clients are most suitable for Web applications that can determine the client configuration and browser version. The client communicates with the server over HTTP and uses DHTML, Java Applet, or ActiveX Control to execute business logic. The connectionless feature of HTTP determines that client scripts, ActiveX controls, and Java applets can only interact with client objects. Figure 1 shows the relationship between objects in the schema.


Figure 1 main participants in the fat Web client architecture
When the client displays the received page, it executes embedded scripts. These scripts can be executed in different threads and interact with the page content through the DOM interface.

3. Web Transmission

In addition to using HTTP to communicate with clients and servers, the web transmission mode also supports protocols such as IIOP and DCOM to support distributed object systems. Web pages communicate with remote object servers through remote object piles and remote object transmission protocols. The server manages the lifecycle of remote business objects and provides services to client objects. Figure 2 shows the relationship between components.


Figure 2 main participants in the web transmission Architecture
The remote object pile is an object that is executed on the client and has the same interface as the remote object. When a method is called through this object, these methods are encapsulated and sent to the remote object server using the remote object transmission protocol RMI/DCOM. The server interprets the request, instantiates the request, and calls the methods in the actual object instance.

In practice, the above architecture is often used according to business needs. In our institute's management system, we have integrated the Thin Web Client and web transmission architecture. The client uses JavaScript for client verification and submits the verified data to the server for processing. In the background management of data, the web transmission architecture is used to maintain the open connection between the client and the server for a long and complex session.

UML web application extension

Unified Modeling Language (UML) is a common visual modeling language. It is applicable to various software development methods, various stages of the software life cycle, various application fields, and various development tools. However, when modeling a web application, some of its components cannot match the standard UML modeling elements one by one. Therefore, UML must be extended.

Three core extension mechanisms of UML include constructor, tag value, and constraint. The most important extension mechanism is constructor, which cannot change the structure of the original model, but can add new semantics to model elements, it is usually represented by "constructor name. A constraint is the semantic relationship in the model element. It defines how the model is organized together. It is usually represented by a string. Tag value is an extension of the features of model elements. Most model elements are associated with the feature, which is usually represented by a string with parentheses.

1. Web page Modeling

Web pages may contain both client scripts and server scripts. Therefore, you must perform modeling separately. The web page on the server usually contains scripts executed by the server. Each request is combined on the server to update the Service Logic status and return it to the browser. The client web page may contain data, representations, and even business logic, which are interpreted and executed by the browser and can be associated with client components, such as Java Applet, ActiveX, and plug-ins. The two are correlated through the ing relationship. What is the constructor of this association? Build ?.

The hyperlink in the Web application represents the navigation path, which is constructed? Link? . The tag value is used to define a list of parameters passed along with the hyperlink request for use on the server web page. Figure 3 describes the relationship between web pages.


Figure 3 Relationship Between Web pages
In the. NET Framework, most web pages are created on the server. After compilation, HTML is generated. Code To the client browser. To improve efficiency, for web pages that do not contain business logic. in the. NET Framework, you can directly use HTML elements to create client web pages, and then establish the call relationship with the corresponding server-side web pages.

2. Form Modeling

Forms are the basic input mechanism of web pages, including <input>, <SELECT>, and <textarea>. They are modeled using form constructor. Form does not have any operations. The interaction with form contains the features of the web page of the form. It can be associated with the applet or ActiveX control that serves as the input control, and the form content can be submitted to the server for processing. Figure 4 describes the interaction between the client web page and the server that contains the form.


Figure 4 interaction between client web pages and servers containing forms
In. net, each page has only one form that contains all input elements, usually expressed as a server-side control or client control. The server-side control is compiled by the server-side web page and then transmitted to the client.

3. Component Modeling

Components in web applications are divided into server-side components and client-side components. Complex business logic on the server side is usually completed by the middle layer, including a set of compiled components that encapsulate all business logic. Therefore, using the middle layer not only improves performance, but also shares the business functions of the entire application. Common components of client web pages are Java Applet and ActiveX. They are used to access various resources of browsers and clients to implement functions that cannot be implemented by HTML.

Web Application Extensions define two abstract component constructor types: Static Page and dynamic page. Static Page implements client components. The main task of dynamic page is to provide a ing between the physical files of the system at runtime and the logical representations in the logical view. Figure 5 and figure 6 represent the logical view of the two components.


Figure 6 client components implemented by Static Page



Figure 5 logical view class implemented by dynamic page
4. Framework Modeling

Web application extension defines the constructor frameset, target, and link constructor targeted link to model the framework. Frameset directly maps the <frameset> tag to HTML. Target indicates other web pages or frameworks referenced on the current web page. Targeted link is a hyperlink pointing to another web page, but it must be provided in a specific target. Figure 7 shows the framework model of thesis management


Figure 7 thesis management framework model

Web Application Development Based on. NET Framework

. Net Framework is a general-language-based programming framework that provides a brand new programming model: webform model and WebService model. It provides a complete base class library and Database Access Technology ADO. net and network development technology ASP. net, providing powerful support for Web application development.

1. Web page implementation

The. NET Framework provides a webform development model that uses embedded server components to generate server-side web pages. It can contain some important page elements: user controls or custom controls. The user control is a file with the. ascx extension in the. NET Framework. It can be used on multiple web pages for code reuse. Custom Control custom control is a control created in. Net or modified on the original control to add new features to meet specific requirements. It can be used by multiple applications.ProgramCall.

2. Web page navigation

The page navigation method in the. NET Framework reflects the relationship between web pages, which can be implemented in the following four ways.

(1) hyperlink

The HTML hyperlink control or hyperlink control can be used to implement links between pages. The hyperlink server control allows you to change the navigateurl attribute in the code to construct a hyperlink that can dynamically change according to the current state of the application.

(2) implement with response. Redirect

When the response. Redirect () method is called, an HTTP response is created, indicating the status code 302 (indicating that the target has changed) and the new target URL. The browser receives the response and sends a request to the new URL. That is, the redirection operation occurs on the client and involves two communications with the server.

(3) implement with server. Transfer

This method transfers the execution process from the current ASPX page to another ASPX page on the same server. However, the new page still uses the response stream created on the previous page. The URL in the browser does not change, and the redirection is performed on the server side. Therefore, this method can avoid unnecessary network communication and achieve better performance and browsing performance.

(4) implement with server. Execute

This method allows the current ASPX page to execute the specified ASPX page on the same server. After the specified ASPX page is executed, the control process returns to the original page to issue the server. where execute () is called. The called page can access the form data of the called page and query the string set. By default, the output of the called page is appended to the current response stream. However, server. the execute () method has an overloaded method that allows a textwriter object to obtain the output of the called page, rather than directly appending it to the output stream, on the call page, you can easily adjust the location of the output result of the called page.

3. Database Operations

The database is at the bottom of the Web application and stores system data and some background database logic, such as stored procedures and triggers. It is separated from the business logic layer and user interface, and is easy to manage and maintain. It features high execution efficiency and good security performance.

(1) Oracle Database Operations

. Net Framework provides the system. data. oracleclient and system. data. oledb namespace, which supports Oracle databases. The former is highly targeted and used in the example in this article.

The database connection string provides necessary parameters for connecting to the database. It is usually stored in the configuration file web. config to simplify code implementation and facilitate deployment.

Database operations are frequently performed in Web applications. Generally, database operations are integrated into a database operation class. You only need to call these methods to perform database operations.

(2) lob object access in Oracle Database

The access to binary files, images, and large text in Web applications in databases is usually implemented with large objects (LOB .. The. NET Framework provides the oraclelob class to perform operations on blob, clob, nclob, and other data types in Oracle. In Oracle, the process of storing large text segments into the clob field can be expressed:

① Use an SQL statement to add a record with the clob field empty_clob () to the database;

② Start the transaction, lock the newly added record, and write the content to be written into the clob field using the stream or clob's write () method;

③ Commit the transaction and write the clob field;

The read process for clob data in Oracle is relatively simple, and database records do not need to be locked:

① Execute an SQL statement to obtain the oracledatareader object;

② Use the getoraclelob () method of the oracledatareader object to obtain the oraclelob object of the clob field to be read;

③ Use the read () method or stream of the oraclelob object to read the content of the clob field;

Conclusion

System Modeling is very important to the software development process. The extension mechanism of UML provides necessary support for Web application modeling .. Net Framework provides a good solution for Web application development. This article first analyzes the architecture of common web applications, and then models the UML Model of Web applications based on. in combination with the development of the. NET Framework, a method for modeling various objects in Web applications is proposed, and important issues related to the development process are described, it also provides detailed solutions for the Oracle database operations that are rarely involved in the existing literature, hoping to serve as a reference.

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.