OOP and Web Applications Michael Juřek Architect Evangelist Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
The Web Warrior Guide to Web Design Technologies
DT228/3 Web Development WWW and Client server model.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
Languages for Dynamic Web Documents
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 1.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Introduction to ASP.NET
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
IST346:  Web Services. Today’s Agenda  Learn the basics of how the Web works  Understand various web service architectures  Address scaling, security,
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
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.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
AJAX in ASP.NET James Crowley Developer Fusion
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital Media.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Server Control Tips & Tricks Presented by: Patrick Hynds Microsoft Regional Director CriticalSites CTO MCSD, MCSE+I, MCDBA, MCSA, MCP+Site Builder, MCT.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Beginning ASP.NET (Part 3).NET 2.0 Core Libraries Tuc Goodwin.
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,
Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Event Handling & Viewstate CS 351 Ed Gellenbeck. Today Review of Web Forms ASP.NET Object Hierarchy Events State Management Page State Session State Application.
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.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
Applications Active Web Documents Active Web Documents.
ASP.NET Forms.
Introduction to .NET Framework
MVC and other n-tier Architectures
Haritha Dasari Josue Balandrano Coronel -
Design and Maintenance of Web Applications in J2EE
Lecture 1: Multi-tier Architecture Overview
Presentation transcript:

OOP and Web Applications Michael Juřek Architect Evangelist Microsoft Corporation

Agenda Web development – overall context Web development – overall context OOP Principles and ASP.NET OOP Principles and ASP.NET ASP.NET object internals ASP.NET object internals  Lifetime issues  Maintaing state  Handling events

Desktop Development OOP oriented for years OOP oriented for years Great tools (Visual Basic, Delphi, …) Great tools (Visual Basic, Delphi, …) Visual composition of application UI Visual composition of application UI Developer wires the objects through interaction via events Developer wires the objects through interaction via events Lots of components available: Lots of components available:  Packaged with a tool  For free  For money  Grow your own Only drawback = COST OF DEPLOYMENT Only drawback = COST OF DEPLOYMENT

ASP / PHP – fast facts Revolutionary at their time (1996) Revolutionary at their time (1996) Most popular web development environments Most popular web development environments Linear programming model (up-down) Linear programming model (up-down) Hard to maintain code, mixing of logical layers, “spaghetti code” Hard to maintain code, mixing of logical layers, “spaghetti code” Impossible to provide real development environment (-> expensive development) Impossible to provide real development environment (-> expensive development) Other technologies suffer from similar pains (JSP, PHP, Cold Fusion) Other technologies suffer from similar pains (JSP, PHP, Cold Fusion)

ASP.NET – goals Be object oriented Be object oriented Mimic desktop paradigm - “Visual Basic for Web” Mimic desktop paradigm - “Visual Basic for Web” Much less lines of code (reduced costs) Much less lines of code (reduced costs) Keep application layers distinct (presentation, logic) Keep application layers distinct (presentation, logic) Native, no scripting (performance !!!) Native, no scripting (performance !!!) „Full“ languages - Visual Basic, C#, JScript ® „Full“ languages - Visual Basic, C#, JScript ® Abitilities: Abitilities:  Reliable, Maintainable, Scalabled, Deployable

Power of ASP.NET

Agenda Web development – overall context Web development – overall context OOP Principles and ASP.NET OOP Principles and ASP.NET ASP.NET object internals ASP.NET object internals  Lifetime issues  Maintaing state  Handling events

ASP.NET pages: Principles Server-side controls Server-side controls  Encapsulate visual elements, interact with user  Generate events (value has changed, button was pressed, mouse click, …) Execution is not linear !!! Execution is not linear !!!  Event fired in every execution phase  Init, Load, Render, Unload, etc. Code hooked on events Code hooked on events  Executed during processing or by user action  May be part of ASP.NET page, in separate file or separate dll library

Server-side controls Page class represents web page Page class represents web page  Hierarchy of controls  Page is the root of hierarchical tree  Even static text is LiteralControl object behind the scenes At the end of processing Page.Render() is being called At the end of processing Page.Render() is being called  Propagated down the tree of controls  Each control generates its HTML representation  Multiple client technologies may be supported  DHTML, HTML 3.2, WML, atd. Fully customizable look of control Fully customizable look of control  Total control with the help of Template class

OOP: Inheritance All controls inherit from abstract WebControl and Control classes All controls inherit from abstract WebControl and Control classes Page itself inherits from Control, too Page itself inherits from Control, too Inheritance is everywhere, e.g.: Inheritance is everywhere, e.g.:  Control (generic, Children, Parent, …)  WebControl (web style specific, width, …)  ListControl (working with lists, Items, …)  DropDownList  ListBox

OOP: Encapsulation Every control is fully responsible for behaving as expected Every control is fully responsible for behaving as expected  E.g. it must render HTML that works in common web browsers How to change control’s behavior? How to change control’s behavior?  By setting properties  By calling methods  By setting external objects (context) – but it’s a control’s sole responsibility how it reflects this information

OOP: Polymorphism Control defines basic behavioral characteristics by defining methods as virtual (overridable) Control defines basic behavioral characteristics by defining methods as virtual (overridable) Examples: Examples:  Render()  LoadViewState(), SaveViewState()  CreateChildControls()  OnInit, OnLoad, OnUnload  …

ASP.NET Experience

Agenda Web development – overall context Web development – overall context OOP Principles and ASP.NET OOP Principles and ASP.NET ASP.NET object internals ASP.NET object internals  Lifetime issues  Maintaing state  Handling events

Object lifetime Objects cannot live in client’s browser: Objects cannot live in client’s browser:  No Java Applets  No ActiveX controls  These were unsuccessful technologies Objects live on the server: Objects live on the server:  No persistent connection between client and server (further – think about web farm)  Live only during request processing (~ ms)  Consequences:  You have to keep state somewher  You have to relay events from client to server

Maintaining object state Database? Database?  Correct from architectural perspective  Problematic performance, often “overkill” Web server process? Web server process?  Memory consumption, open door for DOS attacks  What about a web farm? Client? Client?  Need of encryption and digital signatures  Increased client/server traffic (delays, money)  Least evil, this is the default  “ViewState” as a hidden HTML form field

Web Forms Web page lifecycle Page_Load Page_Render, Unload Textbox1_Changed Button1_Click Events 1. „Change“ events 2. „Action“ events Page created and initialized Page resources released

Handling event (PostBack) Server Browser Info processed Event Event handled Event info Updated page Calls event handling routine

Summary Object oriented programming makes development much more efficient Object oriented programming makes development much more efficient Web development is no exception Web development is no exception ASP.NET is the only fully OOP- oriented web development technology available today ASP.NET is the only fully OOP- oriented web development technology available today

© 2001 Microsoft Corporation. All rights reserved.