You are on page 1of 29

Lecture 2

W b Engineering
Web E i i
Architecture

Muhammad Umair Naru


Department of Computer Science
COMSATS Institute of Information Technology,
Islamabad, Pakistan
Contents

ƒ Software architectures
ƒ architectural styles
ƒ architectural patterns
ƒ Three-layer architecture for business information systems
ƒ Web architectures
ƒ layers
ƒ JSP-Model 1/2 architecture
ƒ integration architectures
ƒ Modelling Web architectures
ƒ Core J2EE design patterns

Web Engineering – SS07 (5) – Knapp, Koch © 2


Software Architecture (1)

ƒ “Architecture is defined [...] as the fundamental organization of a system,


embodied in its components, their relationships to each other and the
environment, and the principles governing its design and evolution.” (IEEE
Architecture Working Group, P1471, 1999)

ƒ Architectures describe structure


ƒ components of software systems, their interfaces and relationships
ƒ static as well as dynamic aspects
ƒ blueprint of software system

ƒ Architectures connect software development phases


ƒ requirements mapped iteratively to components and their relationships

Web Engineering – SS07 (5) – Knapp, Koch © 3


Software Architecture (2)

ƒ “Architecture is the set of design decisions [...] that keeps its implementers and
maintainers from exercising needless creativity.” (Desmond F. D’Souza and Alan
C. Wills, 1999)

ƒ Architectures describe different viewpoints


ƒ conceptual view: entities of application domain and their relationships
ƒ process view: system runs, concurrency, synchronization
ƒ implementation view: software artefacts (subsystems, components, source code)
ƒ runtime view: components at runtime and their communication

ƒ Architectures make systems comprehensible and controllable


ƒ structuring according to different viewpoints
ƒ enables communication between different stakeholders

Web Engineering – SS07 (5) – Knapp, Koch © 4


Software Architecture (3)

ƒ “Architecture is a framework for change.” (Tom DeMarco, 1995)

ƒ Architectures describe flexible frames for systems


ƒ how a system may evolve
ƒ architectural principles limit capacity for change

Web Engineering – SS07 (5) – Knapp, Koch © 5


Software Architecture Design (1)

ƒ Architectures depend on technical and non-technical as well as function


and non-functional requirements

non-functional requirements
functional requirements ƒ performance
ƒ from customer ƒ scalability
ƒ from users ƒ reusability
ƒ … ƒ …

experience
technical constraints
ƒ existing architectures
ƒ system software
ƒ architectural styles
ƒ middleware
ƒ previous projects
ƒ legacy systems
ƒ …
ƒ …

Web Engineering – SS07 (5) – Knapp, Koch © 6


Software Architecture Design (2)

ƒ Styles
ƒ ”Style = { Elements, Form, Rationale }” (Dwayne E. Perry and Alexander L. Wolf, 1992)
ƒ independent from realisation, does not directly refer to a concrete application domain
ƒ Patterns
ƒ describe recurrent problems, their context and known solutions
ƒ solutions describe participating components and stakeholders, their responsibilities,
relationships and interplay
ƒ facilitate reuse of established design knowledge
ƒ architectural patterns: fundamental structuring mechanisms, like Model-View-Controller
(MVC)
ƒ design patterns: language-independent solutions for design problems, like Publish-
Subscribe
ƒ idioms: specific programming-language independent implementations, like Counted-
Pointer in C++
ƒ Frameworks
ƒ reusable software system with prefabricated, general implementation which can be
specialized for a ready-to-use application
ƒ describe basic architecture and functionality for an application domain
ƒ reuse of application domain knowledge

Web Engineering – SS07 (5) – Knapp, Koch © 7


Architectural Styles: Client-Server

ƒ Structure

Client (active, master) Server (passive, slave)


• initiates requests • waits for requests
• waits for and receives • processes requests and
replies sends replies

ƒ Interactions
: Client : Server

request()

request()

Web Engineering – SS07 (5) – Knapp, Koch © 8


Architectural Styles: Layers (Tiers)

ƒ Structure

Layer 1 Layer 2 … Layer n

ƒ Interactions
: Layer 1 : Layer 2 : Layer 3
request()
request()
request()

request()
request()

Web Engineering – SS07 (5) – Knapp, Koch © 9


Three-Layer Architecture for Business Information Systems

Presentation

Common services
User interface
Dialog control

Business logic Application kernel

Database access
Data management
Database

Web Engineering – SS07 (5) – Knapp, Koch © 10


Distribution Patterns

ƒ General forces
ƒ business needs vs. construction complexity
ƒ processing style (batch, interactive)
ƒ distribution vs. performance, security, consistency
ƒ software distribution cost

 Presentation Distributed presentation


Dialog control
 Remote user interface
 Application kernel Distributed application kernel
Database access
 Remote database
 Database Distributed database

Web Engineering – SS07 (5) – Knapp, Koch © 11


Architectural Patterns: Model-View-Controller (MVC)

Model
• encapsulate application state
• responds to state queries
• exposes application functionality
state • notifies views of changes state
query change
change
notification
(event)
view
View selection Controller
• renders the models • defines application behaviour
• requests updates from models • maps user actions to model updates
• sends user interaction to controller user • selects view for response
• allows controller to select view interaction • one for each functionality
(event)

Web Engineering – SS07 (5) – Knapp, Koch © 12


Web Architectures: Specifics

ƒ Technological constraints
ƒ HTTP
ƒ Broad variety of technical solutions
ƒ application servers, proxies, firewalls, legacy applications
ƒ checking of quality difficult
ƒ e.g., performance depends on various components, like database, network bandwidth,
processor, memory, code, …
ƒ improvement of quality difficult
ƒ e.g., code performance may not change overall performance substantially
ƒ Technical solutions inhomogeneous and immature
ƒ short product life cycles
ƒ missing standards impede component integration from different manufactures
ƒ many solutions are open source: continuity of development, extendibility, …
ƒ Global access to Web applications
ƒ internationalization, cultural differences

Web Engineering – SS07 (5) – Knapp, Koch © 13


Components of Web Architectures

Client Web Server


Network Firewall Proxy
Browser (fast)CGI
(HTTP/S) Servlet
Plug-ins container
Applets SSI HTML, XML,
Ajax etc. XSL

Media Application Database


External Server Server Server
Applications
Content-
Management-
Server Legacy
Applications
Component of Web
architectures

Request / Response
data flow

Web Engineering – SS07 (5) – Knapp, Koch © 14


Model-View-Controller 2 (MVC 2)

ƒ Adaptation of MVC for the Web


ƒ stateless connection between the client and the server
ƒ notification of view changes
ƒ re-querying the server to discover modification of application’s state

Event
(HTTP request) Controller Set Model

Client
(Browser)
View Get

Update
(HTTP response)

Web Engineering – SS07 (5) – Knapp, Koch © 15


Types of Web Architectures

ƒ Tier aspect
ƒ 2-tier architectures
ƒ n-tier architectures
ƒ JSP model 2
ƒ Struts
ƒ OOHDM-Java2
ƒ integration architectures

ƒ Data aspect
ƒ database centred
ƒ document centred
ƒ multimedia data

Web Engineering – SS07 (5) – Knapp, Koch © 16


2-Tier Web Architecture

Client tier

Client

Server tier

Web server Services

static HTML dynamic HTML


Database
pages pages

Web Engineering – SS07 (5) – Knapp, Koch © 17


N-Tier Web Architecture

Client

Firewall

Proxy

presentation layer
Web server

Application server Backend business


layer
Data services Collaboration Legacy systems

Business logic Enterprise


Information
Workflow Personalization System

Database server Business-to-business data layer

Web Engineering – SS07 (5) – Knapp, Koch © 18


JSP-Model-1 Architecture

Web server

Servlet container

Client

Browser Java bean

JSP

Enterprise
Database server
Information System

Web Engineering – SS07 (5) – Knapp, Koch © 19


JSP-Model-2 Architecture

Web server

Servlet container

Client 1 Servlet
(controller) 2

Browser 3 Java bean


5 4 (model)
JSP
(view)

Enterprise
Database server
1. user request Information System
2. create/change model
3. create/change view
4. generate output
5. server response

Web Engineering – SS07 (5) – Knapp, Koch © 20


Struts Architecture

Web server

Servlet container

Client ActionServlet 2 Action


1
(controller) (sub-controller)
Browser 4 struts-config.xml 3
6
JSP 5 Java bean
(view) (model)

1. user request Enterprise


Database server
2. forwarding to controller Information System
3. create/change model
4. create/change view
5. generate output
6. server response

Web Engineering – SS07 (5) – Knapp, Koch © 21


OOHDM-Java2 Architecture

Web server

Client Controller
1
HTTPRequest
Browser parser
6 Extended view
2

1 JSP Dispatcher
(layout) 3
Model

Navigation 5 Selection of 4 Business


node user interface objects
1. user request
2. forwarding to
dispatcher
3. select/create model Enterprise
Database server
4. identify view Information System
5. enrich with navigation
6. server response

Web Engineering – SS07 (5) – Knapp, Koch © 22


Integration Architectures

ƒ Data
Business logic
ƒ point-to-point,
ƒ external communication (file, batch)
Workflow
ƒ delivery
ƒ direct data access for a single system
(database) Bus (Middleware)
ƒ integration
ƒ shared data storage for several systems
Adapter Adapter
ƒ Functionality
ƒ delivery
ƒ API of a legacy system Wrapper Wrapper
ƒ reconstruction
ƒ in integrated system or in legacy system
ƒ porting System 1 System n
ƒ migration of legacy systems

Web Engineering – SS07 (5) – Knapp, Koch © 23


Integration Architectures: Portals

Client Web server

Browser Aggregation

Portlet 1 Portlet n

ƒ Issues
ƒ performance and scalability Web service 1 Web service n
prediction difficult
ƒ quality-of-service contracts
Content Content

Web Engineering – SS07 (5) – Knapp, Koch © 24


Content Management Architecture

Client

Content delivery system distributing (and caching) contents

Web server

Content management server

Content delivery Dispatch


Publisher
server service

Content Static
additional Syndication database documents
functionalities service
(besides database
access), like billing Aggregation External
of licensing rights service databases
Partner

Web Engineering – SS07 (5) – Knapp, Koch © 25


WebSA: Common Component Meta-Types

ƒ EntityData
ƒ concept in the business domain
ƒ LegacyView
ƒ gate to a legacy system
ƒ Store
ƒ keeping persistent information
ƒ properties for whether read-only; how data is organised (relational, object-oriented, flat
files); which kind of data is stored (content, navigation, presentation)
ƒ DAC
ƒ data access, implements mapping between stored entities and data
ƒ SingletonFunctionLibrary
ƒ special library functions

Web Engineering – SS07 (5) – Knapp, Koch © 36


WebSA: Presentation Layer Component Meta-Types

ƒ UserAgent
ƒ Web client, e.g., a browser
ƒ ClientPage
ƒ content to be presented (including input forms), e.g., HTML
ƒ makes requests to the server
ƒ ServerPage
ƒ server-side scripting, e.g., JSP
ƒ Controller
ƒ receives requests from the presentation components and resends them to the
business logic
ƒ redirects the request of navigation to the server pages
ƒ View
ƒ obtains information from the domain elements and shows the information with output
format

Web Engineering – SS07 (5) – Knapp, Koch © 37


WebSA: Business Logic Layer Component Meta-Types

ƒ Process
ƒ active processing unit
ƒ hasState: stateful or stateless
ƒ isTransactional
ƒ isDistributed: accessed over the network
ƒ isShared: used in multiple sessions
ƒ isSynchronised

ƒ Entity
ƒ business objects, adding functionality to EntityData
ƒ isShared: shared in concurrent transactions
ƒ isManaged: provides access to all instances of the entity type
ƒ isDistributed: accessed over the network

Web Engineering – SS07 (5) – Knapp, Koch © 38


WebSA: Data Layer Component Meta-Types

ƒ ConnectionPool
ƒ manages a set of connections to stores or legacy systems

ƒ DataSource
ƒ physical connection to a store or a legacy system
ƒ isTransactional: data source allows transactions
ƒ isSecure
ƒ isRemote: network access

Web Engineering – SS07 (5) – Knapp, Koch © 39

You might also like