Chapter 9 Web Applications Yingcai Xiao. Enterprise Application Architectures.

Slides:



Advertisements
Similar presentations
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
Advertisements

Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Chapters 14 & 15 Internet Databases. E-Commerce  Bringing new products, services, or ideas to market, supporting and enhancing business operations 
Netscape Application Server Application Server for Business-Critical Applications Presented By : Khalid Ahmed DS Fall 98.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Objectives In this session, you will learn to:
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Chapter 9 Web Applications Yingcai Xiao. Enterprise Application Architectures.
The Architecture of Transaction Processing Systems
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
ASP.NET Programming with C# and SQL Server First Edition
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Web Applications Enterprise Application Architectures Dr. Mohammad Iqbal Thanks to Yingcai Xiao.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Overview of Previous Lesson(s) Over View  Server controls are small building blocks of the graphical user interface, which includes  Text boxes  Buttons.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
ASP.NET 2.0 Chapter 5 Advanced Web Controls. ASP.NET 2.0, Third Edition2 Objectives.
Enticy GROUP THE A Framework for Web and WinForms (Client-Server) Applications “Enterprise Software Architecture”
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
DotNetNuke Portal Private Assembly Development Stan Schultes Stan Schultes Enterprise architect / application developer Enterprise architect / application.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
Introduction to J2EE Architecture Portions by Kunal Mehta.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
MACIASZEK, L.A. (2001): Requirements Analysis and System Design. Developing Information Systems with UML, Addison Wesley Chapter 6 - Tutorial Guided Tutorial.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
Chapter 6 Server-side Programming: Java Servlets
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Module 7: Creating a Microsoft ASP.NET Web Application.
State Management. Agenda View state Application cache Session state ProfilesCookies.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
State Management. Agenda View state Application cache Session state ProfilesCookies.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
ASP.NET P AGE O BJECTS.  Each ASP.NET page inherits the PAGE object  The PAGE supplies 3 built in objects:  REQUEST: All information passed to the.
CIS 375—Web App Dev II ASP.NET 1 Getting Started.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Configuration.
IIS Manager Details Delegated Administration Configuration System.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTERSTAGE BPM ARCHITECTURE BPMS.
Alexey Polovinkin Post graduate student, CMC department.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Session Variables and Post Back
State Management.
Introduction to J2EE Architecture
ASP.NET Application Framework
Chapter 9 Web Applications
Presentation transcript:

Chapter 9 Web Applications Yingcai Xiao

Enterprise Application Architectures

Main Issues for Developing Enterprise Applications User Interface, Data Storage, Security, Business Logic, Networking. To deal with those issues effectively, modern enterprise applications are usually designed as multi-tier applications.

Client Server Interconnection Network A Two-tier Application (Client-Server)  Multi-tier Application: an application consists of multiple programs each may reside on a different system. Multi-tier Applications

Client Database Server Application Server Interconnection Network A Three-tier Application  In a three-tier application, a Database Server is an independent program deployed as a part of the application to store data. Multi-tier Applications

A Four-tier Application Multi-tier Applications Client Database Server Application Server Internet Web Server  A Web Server is added.  It uses the standard protocols (HTML/HTTP) to communicate with the client.  The client is thin: a standard web browser.

 Client: interface to the user. It should be as thin as possible. Thin-client: no software to install on the client site except a standard web browser. Thin-client makes applications easy to deploy, easy to maintain and easy to upgrade.  Web Server: communicates with the user interface.  Application Server: business logic implemented here with tools from ASP.NET, J2EE, WebLogic (BEAS), WebSphere (IBM). Most application servers have separate modules to dynamically generate user interfaces to be sent to the client by the web server.  Database Server: persistent data stored for the application.  All three server could reside in the same server hardware. Multi-tier Applications

J2EE Java 2 Enterprise Edition ( a platform for developing multi-tier enterprise applications with standardized modular Java components provides a complete set of services to handle many details automatically takes advantage of many features of the Java 2 Platform, Standard Edition (J2SE)

J2EE Application Architecture Thin Client Application Server (BL) DB Server J2EE-Enabled Web Server Application Server (UI)

.NET Web Applications are applications built for the Web using the.NET framework. The applications use Web forms to provide user interface, per-user data stores to hold shopping carts, caching services to boost performance, and security services to identify users and prevent unauthorized accesses..NET Web Applications are actually Application Servers in the four-tier architecture. Other programs (client, web server, database server) need to be there to make the applications work. The those programs can be shared with other applications..NET Web Applications

DBMS / Database ServerApplication Server WEB S E R V E R WEB C L I E N T Database User Interface Database Engine Supporting Software Database API Application Logic App User Interface Architecture of a Four-Tier Application

Architecture of a Three-Tier Application DBMS / Database Server Database User Interface Database Engine Supporting Software Application Server Database API Application Logic App User Interface CLIENTCLIENT Architecture of a Three-Tier Application

ASP.NET Web Application Structures

Structure of an ASP.NET Web Application An ASP.NET application.  The Web.config File To support XCOPY installs— to install applications by copying them to a directory and uninstall them by deleting the files and directories.

Structure of an ASP.NET Web Application An ASP.NET (web) application (server) consists of all the files in a virtual directory and its subdirectories on the HW server. ASPX files containing Web forms (unlimited) ASCX files containing user controls (unlimited) Web.config files containing configuration settings (one per directory) A Global.asax file containing global application elements (only one for the entire application) DLLs containing custom types employed by the application (unlimited, must be in the bin directory under the root of the virtual directory)

Create a Web Application in IIS * You need to be an administrator to use IIS  winserv1 -> Sites -> Default Web Site  Right-click->Add Application (not Virtual Directory)  Alias: xiaotestLander  Application pool: defualtAppPool  Physical path: C:\inetpub\wwwroot\xiaotest\Lander Existing directories can be converted to Web Applications winserv1 -> Sites -> Default Web Site->xiaotest Right-click on Lander Convert to Application Application pool: defualtAppPool

Extensible Markup Language A markup language for documents containing structured information. The XML specification defines a standard way to add markups to documents to identify structures in a document. Both the tag semantics and the tag set are user definable. A meta-language for describing (defining) markup languages. Commonly used to describe data transmitted over the Internet. XML

Web.config  Web.config is the XML file in which ASP.NET applications store configuration data. Not in the registry anymore. Case sensitive. Inherited, can be overridden by subdirectories. Machine.config is at the root. Under Windows\Microsoft.NET\Framework\vn.n.nnnn\Config

Web.config Use system.web in.config to set system-wide configurations. ‘customErrors mode="Off”’ means “systemErrors mode” on.

Debugging Each web application needs its own application directory. For a web form application, the application directory containing the web form is treated as the root of the web “application”. e.g. Copy files from “Examples/c9/Debug” to a A.D. Edit calc.aspx in it. Change op1 in “OnAdd” to op11 Better view it with I.E. Show Detailed Compiler Output

Debugging

Web.config Three custom errors modes 1.On: displays custom errorMessage.html locally and remotely 2.Off (default): displays debugging information locally and remotely. (Dangerous!) 3.RemoteOnly: displays debugging information locally and errorMessage.html remotely

Debugging Custom error mode “On”, but no defaultRedirect

Web.config Default custom error mode is Off: very Dangerous! Displays (code) debugging information locally and remotely.

Web.config Strings defined in the.config file can be retrieved in the program at run time: string conn = ConfigurationSettings.AppSettings ["MyConnectionString"]; <add key="MyConnectionString" value="server=db1; database=pubs; uid=sa; pwd=" /> <add key="connectString" value="Integrated Security=true;Initial Catalog=pubs; Data Source=XIAO-T23-01" />

text file application-level only one for each application directives event handlers declarations Global Directives: The Global.asax File

 Global Event Handlers For events that aren’t specific to a particular page but that apply to the application as a whole: Application_Start, Application_End, Session_Start, Session_End, Application_Error. An application consists of multiple pages (static structure). An application can support multiple sessions at runtime, one for each client (dynamic structure).  Global Object Tags Session["MyShoppingCart"] = new ShoppingCart (); To use in an application: <object id="MyShoppingCart" class="ShoppingCart" scope="session" runat="server" />

to improve application performance data stored in memory as dictionaries of key/value pairs string keys available to all parts of an application (global) Application Cache is replacing Application State. Application State & Application Cache

The Application Cache A per-application, in-memory data store. System.Web.Caching.Cache Pages: Page.Cache Global.asax: HttpApplication.Context.Cache Insert Cache.Insert ("AMZN", 12.00);// or Cache["AMZN"] = 10.00; // replace existing entry Remove Cache.Remove ("AMZN"); Usage decimal amzn = (decimal) Cache["AMZN"];

The Application Cache Locking System.Threading.ReaderWriterLock rwlock.AcquireWriterLock (Timeout.Infinite); Expiration (new) Absolute: Context.Cache.Insert ("Stocks", stocks, null, DateTime.Now.AddMinutes(5), Cache.NoSlidingExpiration(); Sliding (expires only if not accessed): Cache.NoAbsoluteExpiration (); Cleaning Callbacks Context.Cache.Insert (…, new CacheItemRemovedCallback (RefreshDataSet));

 Session State: per-user store to support shopping cart (equivalent to global variables) Challenge: the Web is stateless. Client side store: cookies (users may disable cookies) Server side store - in memory (down with IIS, no Web farms (clusters of Web servers act as one)) ASP.NET session store: Cookies: client side store Cookieless: server side store – in memory, in another process, on another machine, in a database When Calc.aspx is accessed by a client

Session State Process Models ModelDescription In-proc Stores session state in-process to ASP.NET (that is, in Aspnet_wp.exe) (default) State Server Stores session state in an external “state server” process on the Web server or on a remote machine (slower) SQL Server Stores session state in a Microsoft SQL Server database on the Web server or on a remote machine (slowest, scalable and reliable, for e-commerce)

Change session state type in Web.config <sessionState mode="StateServer" stateConnectionString="tcpip= :42424" /> <sessionState mode="SQLServer" sqlConnectionString="server=localhost;uid=sa;pwd=" />

Using Session State Page access: System.Web.UI.Page.Session property Global.asax access: System.Web.HttpApplication.Session property Both map to an instance of System.Web.SessionState.HttpSessionState Add an item: Session.Add (" ", "Quantity=1"); Session[" "] = "Quantity=1"; Retrieving an item: string value = Session[" "];

Using Session State Retrieving all items: NameObjectCollectionBase.KeysCollection keys = Session.Keys; foreach (string key in keys) {…} Remove, RemoveAt, and RemoveAll. Session timeout: Close session: Session.Abandon (); Session Identification: using GUIDs (globally unique identifiers) Automatic lock and unlock

<% if (Session.IsNewSession || Session["Count"] == null) { Session["Count"] = 1; Response.Write ("Welcome! Because this is your first visit to this site, a new session has been created for you. Your session ID is " + Session.SessionID + "."); } else { Session["Count"] = (int) Session["Count"] + 1; Response.Write ("You have visited this site " + Session["Count"] + " times. Your session ID is still " + Session.SessionID + "."); } %> Using Session State

A session is created for each client process and stored on the server. NS and IE are on different processes. Using Session State BrowserCtrl NStart->Programs IENew Thread Old Session New Process New Session (old IE) Old Session (newer IE) NSNew Thread Old Session New Thread Old Session To make your program work deterministically, your application needs to identify the user through the login authentication and respond accordingly (next chapter).

State Server or SQL Server session state models require types stored in session state to be serializable. [Serializable] public class ShoppingCart {... } ShoppingCart cart = new ShoppingCart (); Session["MyShoppingCart"] = cart;

A mini enterprise application Congo (C9) Congo: A virtual storefront for an online bookseller. Related to: database => data grid => shopping cart Forms: Database supported, web based security. Deployment: T:\Xiao\Windows Programming\Examples\C9\Congo-MySQL Output format in C#