Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Azeddine Chikh IS444: Modern tools for applications development.

Similar presentations


Presentation on theme: "Dr. Azeddine Chikh IS444: Modern tools for applications development."— Presentation transcript:

1 Dr. Azeddine Chikh IS444: Modern tools for applications development

2 Part 4. Web Based application development Chapter 8: Assembling a Three-Tier Web Form Application

3 3 Objectives Understand the concept of state for Web applications Create an ASP.NET user control Use data binding technology Learn about Web services

4 4 Understanding the Concept of State for Web Applications Hypertext Transmission Protocol (HTTP) Used by the Internet A stateless protocol Does not know whether the request is a single request or part of a sequence of requests from the same user

5 5 Maintaining State Options available in HTTP for maintaining state: Application state Uses the Application object for information that needs to be available to all users on the site Session state Uses the Session object Information persists only for the duration of the session of a particular client

6 6 Maintaining State Options available in HTTP for maintaining state (continued): Cookies Save small amounts of information, less than 4 K, in a file on the client's computer Information persists for an assigned length of time Database Saves large amounts of information Information persists beyond the session

7 7 Understanding Application State and the Application Object Application object Can be used to save global information that can be shared among all users of a Web application Only one is available for each Web application Application variables in ASP.NET Stored centrally Can be accessed through the Application property of the ASP.NET Page class Global.asax file  Contains the initial application state variable

8 8 Understanding Application State and the Application Object Application variable values are available to all users of the Web site Conflicts can occur if multiple users try to change the same variable’s value at the same time Solution Before changing the value of an application variable  Invoke the application’s Lock method After the change has been made  Invoke the application’s Unlock method

9 9 Understanding Session State and the Session Object Session object Provides a way to keep information about a user throughout multiple requests to a Web application A session Begins when the user enters the Web site Ends when the user leaves the Web application or a timeout occurs  Default timeout is typically 20 minutes

10 Understanding Session State and the Session Object 10 Session data is used in: Shopping cart or basket Web applications Web pages which offer personalization

11 11 Using Cookies A cookie A small text file saved on the computer by the Web application Provides a way to save state beyond the current visit Often used for keeping User preferences Information for logons

12 12 Using Cookies Browser settings regarding cookies Default: allow the computer to accept cookies Can be changed to prevent cookies from being written to the computer Expiration of a cookie Applications can set an expiration date Otherwise, a cookie expires when the session ends

13 13 Using Cookies Cookies Written using the response object Retrieved using the request object Can be Single-value Multiple-value

14 14 Using the ASP.NET Session State Control ASP.NET can be configured to work without cookies by using its own session state model In this model ASP.NET server serializes all objects in the session collection to the session state store at the end of each Web request Storage of session state  Default settings: The session state store is kept in cached memory  Can be configured to store the session state to a database

15 15 Creating an ASP.NET User Control User controls Web forms that consist of ASP server controls and HTML code without tag A user control file Created within an existing application Has an.ascx extension

16 16 Creating an ASP.NET User Control An example of using user controls A Web application navigation system Can be easily placed in all the Web forms of the Web application

17 17 Creating an ASP.NET User Control

18 18 Using Data Binding Technology Data binding technology Provides a means to tie the property of a control to an underlying source of data Data bound or data aware controls Controls which are bound to an underlying source of data Do not need to be repopulated when the data changes

19 19 Understanding the DataGrid Control ASP.NET “data bound only” controls Designed for presenting data on Web forms Include Repeater DataList DataGrid

20 20 Understanding the DataGrid Control DataGrid control Like an HTML table that provides enhanced features such as Column sorting Pagination In-grid updating Flexible formatting

21 21 Understanding the DataGrid Control

22 22 Understanding the DataGrid Control In two-tier applications The data grid is typically bound directly to the data sets of a database In three-tier applications The array list intermediates as the middle tier between the data and the presentation An ASP.NET DataTable control Handles the data and binds the grid to it

23 23 Understanding the DataGrid Control To create a DataGrid control Create a table Populate the table with data from the array list Bind the data grid to this data table Configure the data grid Use the DataGrid Properties dialog box

24 24 Understanding the DataGrid Control

25 25 Understanding the DataGrid Control DataGrid Properties dialog box can be used to Define the general properties of the grid For example: how data is sorted Set properties of Columns Paging behavior Format of the grid Border of the grid

26 26 Understanding the DataGrid Control

27 27 Understanding the DataGrid Control

28 28 Understanding the DataGrid Control

29 29 Developing a Web Application based on a three-tier approach Use of the request/response Web model

30 30 Understanding Web Services A Web service Technically The resulting service for any HTTP request Common view A Web service is based on the Internet and XML (essentially XML Web services) A Web service performs a specific functional requirement

31 31 Understanding Web Services The.NET framework provides tools for creating Web services Technologies involved in creating Web services Simple Object Access Protocol (SOAP) Web Services Description Language (WSDL) Universal Description, Integration, and Discovery (UDDI)

32 32 Understanding Web Services Simple Object Access Protocol (SOAP) A messaging protocol Provides a way to wrap information required to be sent with a request to a Web service Serves as a wrapper for the information returned from the Web service

33 33 Understanding Web Services Web Services Description Language (WSDL) Defines all of the interactions of a Web service regardless of the computing platform on which the Web service is running Universal Description, Integration, and Discovery (UDDI) Provides a mechanism for discovering available Web services

34 34 Summary HTTP is a stateless protocol Application state, Session state, and cookies assist in maintaining state between the client and the server Both two tier and three tier Web processing relies on the request/response model ASP.NET user controls provide consistency to Web forms ASP.NET’s data binding technology allows properties of Web server controls to be bound to an underlying data source

35 35 Summary Web services distribute logic over the Internet SOAP provides wrappers around structures sent to a Web service and returned from a Web service WSDL is a platform-independent standard for describing data for Web services UDDI assists in locating and using Web services


Download ppt "Dr. Azeddine Chikh IS444: Modern tools for applications development."

Similar presentations


Ads by Google