Internet Engineering: Web Application Architecture Ali Kamandi - - PowerPoint PPT Presentation
Internet Engineering: Web Application Architecture Ali Kamandi - - PowerPoint PPT Presentation
Internet Engineering: Web Application Architecture Ali Kamandi Sharif University of Technology kamandi@ce.sharif.edu Spring 2007 Centralized Architecture mainframe terminals terminals 2 Two Tier Application Architecture In the 90s,
Centralized Architecture
terminals mainframe terminals
2
Two Tier Application Architecture
In the 90’s, systems should be client- server
3
Client-Server Architecture
Client-Server divides programs into two types Server – manages information system resources or provides well defined services for client Client – communicates with server to request resources
- r services
Advantage – Deployment flexibility scalability, maintainability Disadvantage – Potential performance, security, and reliability issues from network communication
4
3 Layer Architecture
5
Three-Layer Architecture
Layers can reside on one processor or be distributed to multiple processors Data layer – manages stored data in databases Business logic layer – implements rules and procedures
- f business processing
Presentation (View) layer – accepts user input and formats and displays processing results
6
Web Architecture
PHP script Web Server (Apache, IIS) Browser (IE, FireFox, Opera) Desktop (PC or MAC) Database Database Server SQL HTTP HTML data DHTML
Presentation HTML+DHTML Dynamic HTML Generation, Business Logic Persistence
7
Enterprise Application Model
8
Internet and Web-based Application Architecture
Web is complex example of client-server architecture Can use Web protocols and browsers as application interfaces Benefits
Accessibility Low-cost communication Widely implemented standards
9
Negative Aspects of Internet Application Delivery
security Fluctuating reliability of network throughput, slow speed Volatile, changing standards
10
Presentation layer (Client Side)
Issue request to remote server using appropriate protocol (usually HTTP) Accept and render the returned HTML (or JPEG, ..) file Allow plug-ins to handle new file types execute client-side scripts in JavaScript Accept user input via a variety of controls on a form
11
Application Layer: Server Side Presentation + Business Logic
Server (Apache, IIS) Identifying appropriate action to take – fetch a file Sending output back to caller Support for: thousands of concurrent users multi-threading [ allow multiple processes to run concurrently] caching [holding results in a temporary store to reduce re- calculation] Server Script (e.g. in PHP) Interacting with the server (accessing input and generating
- utput)
interpreting the requests according to business rules requesting the appropriate data from the Persistence layer computing derived data creating the HTML (or GIF, ...) for the page
12
Persistence layer
interaction with the database using standard languages e.g. SQL queries using database-specific protocol over TCP/IP define and modify the data structures (e.g. tables) insert, update and delete data maintain data persistently, with backup and recovery handle transactions to support concurrent access to the database via locking
- ptimise access by compilation of queries, indexing,
replication of tables etc.
13
Enterprise IT Requirements
DB2
DATA WAREHOUSE BACK OFFICE FRONT OFFICE APPLICATION INTEGRATION Legacy Apps Purchased Apps Thin Client Apps Business Intelligence INTERNET On-line Integration
SAP
Custom Apps Off-line Integration
14
Middleware
Connects parts of an application and enables requests and data to pass between them
15
CORBA
A distributed component-oriented model An architecture for defining components and their interactions From client-side (GUI) to server-side (business) components A container framework: lifecycle, security, transactions, persistence,… The Industry’s First Multi-Language Component Standard Multi-languages, multi-OSs, multi-ORBs, multi- vendors, etc.
16
What is the purpose / goals of CORBA?
Enable the building of plug and play component software environment Enable the development of portable,
- bject oriented, interoperable code that is
hardware, operating system, network, and programming language independent
17
How to meet goals?
Interface Definition Language (IDL) Object Request Broker (ORB)
18
Interface Definition Language (IDL)
Language Independence Defines Object Interfaces Hides underlying object implementation Language mappings exist for C, C++, Java, Cobol, Smalltalk, and Ada
19
Interface Definition Language (IDL)
module <identifier> { interface <identifier> [:inheritance] { <type declarations>; <constant declarations>; <exception declarations>; <attribute declarations>; [<op_type>] <identifier>(<parameters>) [raises exception][context]; } }
Defines a CORBA object Defines a method Defines a container (namespace)
20
IDL Compiler
IDL Definitions IDL Compiler Stubs Skeletons
1. Define objects using IDL 2. Run IDL file through IDL compiler 3. Compiler uses language mappings to generate programming language specific stubs and skeletons
21
Implementation of CORBA specification Middleware product Conceptual Software Bus Hides location and implementation details about objects
Object Request Broker (ORB)
22
Client / Object Interaction
Client Obj Impl IDL IDL ORB Client Obj Impl IDL IDL ORB Network TCP/IP OSI ATM TCP/IP OSI ATM
23
CORBA Services
Provide basic infrastructure functionality Currently there are more than 15 defined services
Naming - maps human names to object references Event Object Trader - discover objects based on the services they provide (Yellow Pages) Transactions – allows distributed objects to participate in atomic transactions
24
Enterprise Application Model
25
J2EE clients
Web clients
Dynamic web pages with HTML, rendered by web browsers. Can include applets. Communicates with server typically using HTTP.
Application clients
User interface using GUI components such as Swing and AWT. Directly accesses the business logic tier.
26
Web-tier Components
Client can communicate with the business tier either directly or through servlets or JSP that are located in the web-tier. Servlets are special classes to realize the request-response model (get, post of HTTP). JSP is a developer-friendly wrapper over the servlet classes.
27
Business-tier Components
Business logic, rules, computation Enterprise Java Beans (EJB) can be used to implement this tier. This tier receives the data from the web- tier and processes the data and sends it to the EIS-tier and takes the data from the EIS and sends it to the web-tier.
28
Enterprise Information System (EIS) Tier
In general this corresponds to the database (relational database) and other information management system. The other information management systems may include Enterprise Resource Planning (ERP) and legacy system connected through open database connectivity.
29
Enterprise Java Bean (EJB) (1)
EJBs are distributed components used to implement business logic (no UI) Client of EJBs can be JSPs, servlets,
- ther EJBs and external aplications
Clients see interfaces
30
Enterprise Java Bean (EJB) (2)
At run-time, an enterprise bean resides in an EJB container. An EJB container provides services such as security, transaction, deployment, … Process of installing an EJB in a container is called EJB deployment.
31
Enterprise Java Bean (EJB) (3)
Entity Beans
Represent persistent business Entity Persisted in storage system (usually Database)
Session Beans
Encapsulate complex business logic Can coordinate transactional work on multiple entity beans
Message Driven beans
32
States and Persistence
Session beans can be
Stateless- belong to client for duration of a method call Stateful- belong to client for duration of client conversation
Entity beans can have
Bean-managed persistence- The developer writes SQL code to store, retrieve and update database Container managed persistence- The developer provide database mapping information that allows the container to manage persistence
33
JMS
Point-to-point
Destination is “queue”
34
JMS
Publish-subscribe
Destination is “topic”
35
What is Application Server
Application servers enable the development of multi-tiered distributed applications. They are also called “middleware” An application server acts as the interface between the database(s), the web servers and the client browsers
36
J2EE Application Servers
Major J2EE products:
BEA WebLogic IBM WebSphere Sun iPlanet Application Server Oracle 9iAS HP/Bluestone Total-e-Server Borland AppServer Jboss (free open source) …
37
JBoss
Created in 1999, JBoss is the product of an OpenSource developer community dedicated to developing the best J2EE-compliant application server in the market With 1000 developers worldwide and a steadily growing number of downloads per month, reaching 72,000 for October ’01 (per independent www.sourceforge.net), JBoss is arguably the most downloaded application server in the world today JBoss is absolutely FREE for use.
38
JBoss- Application Server
39
J2EE Benefits
Component based model Container provided services Highly Scaleable Simplified Architecture Flexible security model
40
J2EE Benefits
Integration with existing systems Freedom to choose vendors of application servers, tools, components Multi-platform
41
J2EE Multi-tier Model
42
J2EE Application Scenarios
Multi-tier typical application
43
J2EE Application Scenarios
Stand-alone client
44
J2EE Application Scenarios
Web-centric application
45
J2EE Application Scenarios
Business-to-business
46
J2EE Services and APIs
JNDI - Naming and directory services
Applications use JNDI to locate objects, such as environment entries, EJBs, datasources, message queues JNDI is implementation independent
47
J2EE Services and APIs
Transaction service:
Controls transactions automatically You can demarcate transactions explicitly Or you can specify relationships between methods that make up a single transaction
48
J2EE Services and APIs
Security
Java Authentication and Authorization Service (JAAS) is the standard for J2EE security Role-based authorization limits access of users to resources (URLs, EJB methods)
49
J2EE Services and APIs
J2EE Connector Architecture
Integration to non-J2EE systems, such as mainframes and ERPs. Standard API to access different EIS
Support to CORBA clients
50
.NET Developer Tools
Visual Studio.NET is an integrated development environment for developing .NET applications It includes support for multiple languages
Visual Basic.NET Visual C#.NET Visual J#.NET ASP.NET
51
.NET High Level Description
Common Language Runtime Platform Interoperability
"You very seldom want to port an existing application between platforms, but you do want to interoperate between applications regardless of platform; therefore, industry standard support for Web Services is of great importance.”
- Dan Fox, Solutech, Inc. Author of: Building Distributed
Applications with Visual Basic.NET
52
.NET Framework Web Services Web Forms Windows Forms Data and XML Classes
(ADO.NET, SQL, XML, etc.)
Framework Base Classes
(IO, string, net, security, threading , text, etc.)
Common Language Runtime
(debug, exception, type checking, JIT compilers)
Windows Platform
53
ASPX
Microsoft Active Server Pages, .NET
IIS Server
Old ASP
HTML with embedded server scripts Session Support VB Scripts
ASPX.NET
Separation of HTML and code Multiple Languages
54
IIS
Internet Information Services (IIS, sometimes Server or System) is a set of Internet-based services for servers using MS Windows Used for corporate, commerce and secure websites. It is integrated with Windows 2000 and Windows 2003 Server.
55
Forrester Report: The State of Technology Adoption
Source: http://download.microsoft.com/download/c/7/5/c75837dc-90bb-44d8-ae70-
db7bcc5980b9/TheStateofTechnologyAdoption.pdf
56
Pros and Cons of J2EE
Pros
Portability Vendor choices for tools and application servers Rich developer community, many free tools.
Cons
Complex application development environment Tools can be difficult to use Java Swing limited for developing GUI's (?) Performance
57
Pros and Cons of .Net
Pros
Easy to use tools Strong framework for building GUI's Language support Performance
Cons
Portability Choice of IDE's Limited
58
.Net and J2EE key differences
Fundamental Philosophy:
“One language, Many Systems” vs. “Many Languages, One System.”
59
Assignment 2
Compare .Net and J2EE See these papers:
http://java.sun.com/performance/reference/whitepapers/WS_Test- 1_0.pdf http://www.gotdotnet.com/team/compare/Benchmark_response.pdf Analyze the benchmarks and prepare a report.
Benchmark approach, fairness, results
Application Architecture (logical)
UI Components Data Access Components User Devices Service Agents Operational Management Security Communication Service Interfaces Owned Data Sources External Services External Service Agents Messaging Infrastructure Business Process Components Business Components Users Presentation Business Logic Data Layer Data and External Systems
61
Solution: Simple Web Application
BC Clients DAC UIC Data Sources Web Clients Web Application Farm Database Clusters
62
Solution: Complex Web Application
BC Clients DAC UIC Data Sources Web Clients Web Farm Database Clusters Application Farm
63
Solution: Extended Enterprise Application
BC Clients DAC UIC Data Sources Web Clients Web Farm Database Clusters Application Farm SA SI
64
Solution: Smart Client Application
BC DAC UIC Data Sources Smart Clients Web Farm Database Clusters Application Farm SA SI
65
Questions
66
.NET Online Resources
http://www.msdn.microsoft.com/netframew
- rk/
http://www.gotdotnet.com/ http://www.startvbdotnet.com http://www.asp.net http://www.dotnetwire.com
67
J2EE Online Resources
http://java.sun.com/j2ee/index.jsp http://library.theserverside.com/rlist/term/J 2EE.html http://www.javaworld.com
68