33
Universitas Gunadarma Web Engineering Web Application Architectures Dr. Mohammad Iqbal Thanks to Federico M. Facca

Web Engineering

Embed Size (px)

DESCRIPTION

Web Application Architectures Dr. Mohammad Iqbal Thanks to Federico M. Facca. Web Engineering. Overview. Introduction Web Application Architectures Summary. What is an architecture?. INTRODUCTION. Software Architectures. - PowerPoint PPT Presentation

Citation preview

Page 1: Web Engineering

Universitas Gunadarma

Web EngineeringWeb Application Architectures

Dr. Mohammad IqbalThanks to Federico M. Facca

Page 2: Web Engineering

Web Engineering (703512)

Overview

• Introduction• Web Application Architectures• Summary

2

Page 3: Web Engineering

Web Engineering (703512)

INTRODUCTIONWhat is an architecture?

3

Page 4: Web Engineering

Web Engineering (703512)

Software Architectures

• “Architecture is defined [...] as the fundamental organization ofa 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

4

Page 5: Web Engineering

Web Engineering (703512)

Software Architectures

• “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

5

Page 6: Web Engineering

Web Engineering (703512)

Developing ArchitecturesInfluences on Architectures

Architecture

Functional Requirements•Clients•Users•Other Stakeholders

Non-Functional Requirements•Performance•Scalability•Reusability•Other?

6

Page 7: Web Engineering

Web Engineering (703512)

Developing ArchitecturesInfluences on Architectures

Technical Aspects•Operating System•Middleware•Legacy Systems•Other?

Architecture

Experience with•Existing Architecture•Patterns•Project Management•Other?

7

Page 8: Web Engineering

Web Engineering (703512)

Developing Architectures

• Remember, requirements are always subject to change.– Organizational & Environment changes– Ambiguous requirements initially

• Thus, iterative approaches are the suggested means of development– Pro: Helps to mitigate design risks– Caution: Doesn’t guarantee a good architecture (ex., What

about legacy systems?)

8

Page 9: Web Engineering

Web Engineering (703512)

Patterns & Frameworks

• Patterns describe recurring design problems• 3 types of patterns

– Architecture patterns (e.g. MVC)– Design patterns (e.g. Publisher-Subscriber)– Idioms (e.g. Counted-Pointer in C++)

• They are a guideline, implementation must be grounded to the specific problem

• Patterns need to be “integrated” among them!

9

Page 10: Web Engineering

Web Engineering (703512)

Patterns & Frameworks

• Frameworks: another option to reuse existing architecture– something that provides you a frame to be filled!

• Reuse of existing software objects that just need to be properly configured

• Bound to a specific technology– Require training– High cost of switch– Level of customization not always accetable

10

Page 11: Web Engineering

Web Engineering (703512)

What is a Framework?

• Framework is a group of components that work interactively with requests from other components or objects to generate a consistent output.

Framework(Black Box)

Java C# C++ VB.Net

Presentation, business rules, database queries, etc

Company business rules, standards, policies

Object(GUI, XML, data, authentication, etc)

Controlled Environment

Page 12: Web Engineering

Web Engineering (703512)

For example, in order for a program to get data from a mysql database, it has to undergo a list of actions:

1. Connect to the database server 2. Select a database 3. Query the database 4. Fetch the data 5. Use the Data

A framework may handle steps 1-4 for you, so that your responsibilities are reduced to:

1. Tell the framework to fetch the data 2. Use the data

What is a Framework?

Page 13: Web Engineering

Web Engineering (703512)

Example Framework

Framework(Black Box)

Java C# C++ VB.Net

Drop Down List, Select * from Users, log fileCompany

business rules, standards, policies Render: Drop Down List of Users on a Web page

or Window Application, recording any errors to the log file

Procedural Application100% complexity

75% complexity 25% complexity

Page 14: Web Engineering

Web Engineering (703512)

Benefits of a Framework

• Consistency across many platforms• Better able to enforce standards and policy• Better way to reuse components• Lower skilled employee can perform work more

efficiently• Single point of change to a common interface• Produce applications that are more robust, faster,

stable and consistent

Page 15: Web Engineering

Web Engineering (703512)

Implementing Framework: Web Services

• A web service is a component that is presented as a URL that returns the desired information or objects

• Web services are built the same way as class objects• Using a web service

– Add a web reference– Add applicable XML documents– Call the web service through a URL, passing the necessary

parameters– Process the information or object returned

Page 16: Web Engineering

Web Engineering (703512)

Presentation Business ObjectsFramework/Web Service

XML

Production/Development

Development

Framework and Web Service Environment

Database

Page 17: Web Engineering

Web Engineering (703512)

Web application frameworks

• Many frameworks are being developed…– JavaServer Faces, Struts, Webwork2– WebObjects (.NET specific)– Model Glue (ColdFusion specific)– Velocity, Fusebox, Mach II, Maypole, Catalyst, Tapestry,

ZNF, Phrame, Cocoon, Ruby on Rails, …

• Most, but not all, are based around M-V-C

Page 18: Web Engineering

Web Engineering (703512)

WEB APPLICATION ARCHITECTURES

18

Page 19: Web Engineering

Web Engineering (703512)

Architecture Types

• Layering Aspect– “Separation of concerns”– How many concurrent users are you serving?– Shared needs among multiple applications? (e.g., security)

• Data Aspect– What kind(s) of data are you delivering?

• Structured vs. non-structured• On-demand vs. real-time

– What are the bandwidth requirements?• Size & nature of data• Again, audience concerns

19

Page 20: Web Engineering

Web Engineering (703512)

Architecture Types

• Web Platform Architecture (WPA)– Platform = Infrastructure

• Hardware• Software modules & configurations• Choice of software platform (e.g., J2EE, .NET)

• Web Application Architecture (WAA)– Conceptual view of how key business processes and

needs are separated & implemented– Often domain-specific– Greater complexity requires greater modularity

20

Page 21: Web Engineering

Web Engineering (703512)

Example of a WAA

Web Application

Presentation Business Logic Data Management

Personalization Security Search

21

Page 22: Web Engineering

Web Engineering (703512)

Generic Web (Platform) Architecture

• The Web “platform” is based on– TCP/IP– HTTP– HTML

• It’s essentially a Client/Server architecture!– In term of patterns one of the simplest one

• But still thing can get complex…– Components on the network (firewall, proxy, load

balancer)– Components in the intranet (Web server, application

server, data base, legacy systems, web services)

22

Page 23: Web Engineering

Web Engineering (703512)

Model View Controller

• Architectural Pattern from Smalltalk (1979)• Decouples data and presentation• Eases the development

23

Page 24: Web Engineering

Web Engineering (703512)

Model View Controller

• Model– encapsulate application state– responds to state queries– exposes application functionality– notifies views of changes

• View– renders the models– requests updates from models– sends user interaction to controller– allows controller to select view

• Controller– defines application behavior– maps user actions to model updates– selects view for response– one for each functionality

24

Page 25: Web Engineering

Web Engineering (703512)

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

25

Page 26: Web Engineering

Web Engineering (703512)

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

26

Page 27: Web Engineering

Web Engineering (703512)

Client/Server (2-Layer)

Client

Web/App Server

Database

Services

Dynamic HTML

Static HTML

Client

Server

27

Page 28: Web Engineering

Web Engineering (703512)

N-Layer Architectures

Client

Application Server(Business Logic, Connectors,Personalization, Data Access)

Presentation Layer

Firewall

Proxy

Web Server

DBMS B2B

Backend(Legacy Application,

Enterprise Info System)

Business Layer

Data Layer

28

Page 29: Web Engineering

Web Engineering (703512)

Why an N-Layer Architecture?

• Separating services in business layer promotes re-use among applications– Loose-coupling – changes reduce impact on overall

system.– More maintainable (in terms of code)– More extensible (modular)

• Trade-offs– Needless complexity– More points of failure

29

Page 30: Web Engineering

Web Engineering (703512)

JSP-Model-1 Architecture

30

Page 31: Web Engineering

Web Engineering (703512)

JSP-Model-2 Architecture

31

1. user request2. create/change model3. create/change view4. generate output5. server response

Page 32: Web Engineering

Web Engineering (703512)

Struts Architecture

32

1. user request2. forwarding to controller3. create/change model4. create/change view5. generate output6. server response

Page 33: Web Engineering

Web Engineering (703512)

Things to keep in mind(or summary)

• Good design of architecture is crucial• You can leverage on patterns and frameworks

– Both have advantages and disadvantages

• Design is constrained on Web “infrastructure”• MVC is the most commonly used pattern

33