12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf ·...

62
12- Exam Procedure And course summary A. Venturini

Transcript of 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf ·...

Page 1: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

12- Exam Procedure And course summary

A. Venturini

Page 2: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Exam

Final dates:

28-30-2013 deadline for the delivery of reports and application

Send by email (use read receipt) to [email protected]

Send the zip file with the application (in case use some file

transfer server

source code

Instruction on how to install the app (sql scripts if needed,

settings)

report

3-07-2013. Project results communicated via email to the

students.

05.07.2013 14:00-16:00 : Written Exam

Page 3: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Examination deliverables

Project: 15 marks:

1) Project Report (correctness of design,

readability) (7,5 marks)

2) Developed portlets (functionality, source

code) (7,5 marks)

3) Written exam (15 marks)

From 15 to 20 questions on the topics of the

course

Threshold for each step: 9 points

Page 4: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Report (1)

To allow different potential readers to understand

your project

For the user or customer

To understand the functionalities that are

provided

For the software architect

To understand the structure of the modules

For the developer

To understand the components to be developed

For the system administrator

To know which are the major building blocks and

how should be deployed

Page 5: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Report (2)

It should be a simple architecture Document

Table of Content:

Introduction

Description through GUI snapshots

Use Case View (could be omitted if the GUI is

sufficiently described)

Infrastructural View

Logical View

Deployment view

Include UML diagrams

Page 6: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Use Cases (1)

Provide a description of the major user functions,

by higlighting the actors (people or external

systems) interacting with the system, from a

functional point of view

Not how the function will be implemented, but

which functionalities the system provide

Page 7: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Use Cases (2)

Use case Diagrams

Actors

Different types of users that interact with the

system

Diagram summarising the use cases

Description of each use case, in a descriptive

form

Page 8: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Use case Diagram: Example

Page 9: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Name: Register Participant User

Actor: The Administrator

Description: This use case describe how to register a

participant into the portal

Precondition: The administrator should be logged

Postcondition: The new user is registered

Basic Flow:

The administrator enter in to the user admin section

…..

The new user has been created

Alternative flow (if any): if the user name already exist,

a different user name suggestion is shown…..

Use Case Description: example

Page 10: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Logical View

Multiple sections, each with one or more

diagrams

Each diagram should be described in the

appropriate section

Page 11: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Presentation Layer

Logical View High Level Architecture (put your major components there)

Services Layer

Dao Access Layer

My GUI Components

Data Beans

Data access pattern

MVC Pattern

Repository

MyService

MyDaoComponent

MyBean

Page 12: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Logical View – Class diagrams

All the layers of the application

Web Layer

Service Layer

Data layer

Class diagram (classes and interfaces)

Use relationships in the correct way

Goal is to provide a good comprehension of the

system

Page 13: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Weather Portlet Class diagram

Page 14: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Logical View – Sequence diagrams

Consider the most significant use cases

Show, by means of sequence diagrams, the

sequence of methods are called when the use

case is executed

It should touch all the layer of the application

Page 15: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Example Class diagram

WeatherPortlet

+doView()

+processAction()

WeatherServiceFactory

+createInstance(): WeatherService

+getFactory(type: String)

WeatherComService

YahooWeatherService

WeatherService

<<interface>>

+getWeatherByCity()

WeatherComServiceFactory

+createInstance(): WeatherService

YhaooWeatherServiceFactory

+createInstance(): WeatherService

Page 16: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Infrastructural View

Infrastructural components, description, roles

and motivations.

Major technologies used

Often is a layered diagram

Page 17: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Example infrastructure view

Application Services

Page 18: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Phisical view

Consider a simple Phisical view:

One physical server hosting the RDBMS and

the portal server

Describes the configuration parameters (db

connection for example)

Page 19: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Coding

Use the best practices we introduced

The code should reflect the design !

Package names should reflect patterns adopted

and application layers

Comment the code (at least the signatures of the

interfaces)

Suggestions:

Start from the Rolodex portlet. Clean it up and

adapt to your needs

http://unibz.ectrldev.com/awsmaterial/Rolodex

-portlet.zip

Page 20: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Summary of the lectures

Page 21: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Software Architecture

Software architecture deals with the design and

implementation of the high-level structure of the

software.

To describe a software architecture, are used a

model composed of multiple views or

perspectives.

In a “Software Architecture Document”, typically

each view is one or more chapters

The project report should be structured like a

software architecture document

Page 22: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

4+1 View Model

Ref: Architectural Blueprints—The “4+1” View Model of Software

Architecture, Philippe Kruchten, IEEE Software, 12

Page 23: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Logical View

The logical view is the object model of the design

supports the functional requirements—what the

system should provide in terms of services to its

users.

The system is decomposed into a set of key

abstractions, taken (mostly) from the problem

domain, in the form of objects or object classes.

They exploit the principles of abstraction,

encapsulation, and inheritance.

Class diagrams and sequence diagrams

Page 24: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Scenarios

The elements in the four views are shown to work together

seamlessly by the use of a small set of important scenarios

(instances of more general use cases)

The scenarios are in some sense an abstraction of the most

important requirements. Their design is expressed using

object scenario diagrams and object interaction diagrams.

A driver to discover the architectural elements during the

architecture design

as a validation and illustration role after this architecture

design is complete, both on paper and as the starting point

for the tests of an architectural prototype.

Page 25: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Portlet Technology

Page 26: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

JSR 168 Value Proposition: Portability of Portlet Apps

JSR 168

Compliant

Portals

Write Once

Deploy to Many

Po

rtle

t In

terf

ace

Page 27: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

What is a Portlet?

Java technology based web component

Managed by a portal container

Generates a piece of markup called “fragment”

Adheres to certain rules such as no <html>

tags, for instance

Fragment generated by a Portlet aggregates

with that from other Portlets to form a portal

page

Fragment generated by a Portlet may

vary from one user to another depending

on the user configuration

Page 28: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Portlet Specifications

JavaTM Portlet Specification

First version: JSR 168

Second version: JSR 286

http://www.jcp.org/en/jsr/detail?id=286

Standard specificatitons defined by the major

portal vendors (ibm, sun, bea, …) for portlet

technologies

Page 29: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Portal and Portlet Interaction

User Portal Portlet

container

Portlets

A B C

render

render

render

processAction

A

B C

A’

B’ C

Action on B Do action on B

Render A

Render B

Render C

These requests

may be done in

parallel

Scope of the Portlet specification Outside of the scope of the Portlet specification

Page 30: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

JSR 286

JSR 168 and JSR 286 are specifications defined

by the JCP, Java Community Process Program

JCP is Program for the development and revision

of Java technology specifications, introduced by

SUN

Specifications led by Martin Scott Nicklous (IBM)

Expert group formed by the major players

(Oracle, Sun, Vignette, BEA, Liferay, Red Hat,

TIBCO…)

http://jcp.org/aboutJava/communityproces

s/final/jsr286/index.html

Page 31: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Extension introduced by JSR 286

JSR 286 allows portlets to send and receive

events

Page 32: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Request lifecycle as extended by JSR286

Page 33: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

serveResource

Page 34: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

View Technologies

Page 35: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

“Models” of JSP development

Origin of the terms “model 1” and

“model 2.”

JSP 0.92 spec: “You can apply the JavaServer

Pages technology in two ways . . . Model 1: A request sent

to a JavaServer Pages file. . . . Model 2: A request sent to

a Java Servlet.”

Page 36: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Simple “model 2” example public void doGet(HttpServletRequest request

HttpServletResponse response) {

// business logic that results in object ’data’

request.setAttribute(”d”, data);

sc.getRequestDispatcher(”/view.jsp”);

}

view.jsp

We have some data to display: <b>${d.property1}</b>

• In this case, the data passed is a simple bean-style object. It could also be an XML document; we’d then use JSTL’s XML-manipulation tags.

Page 37: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

JSTL 1.0 libraries

Library features Recommended prefix

Core (control flow,

URLs, variable access)

c

Text formatting fmt

XML manipulation x

Database access sql

Page 38: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Major patterns and how they are adopted in the Spring Framework

Page 39: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

The Inversion of Control Pattern

Design

and

maintainability

issues

Page 40: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Design maintainable systems

Design maintainable systems

= cope well with change and iterations

key issue: manage dependencies

Other important aspects/techniques:

Design by Contract

clearly define the Contract of a class/interface

(Javadoc)

Contract: what it does, how it behaves

NOT how it is implemented !

Unit Testing

write tests that verify the class/interface's Contract

Separation of Concerns

write a class/interface for every single Concern

Page 41: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

The

Inversion of Control

Pattern

The Inversion of Control Pattern

Page 42: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Inversion of Control (1/5)

A way of wiring components together

wiring = assembling, putting Collaborators together

You define

Interfaces and implementations

Dependencies between

interfaces/classes

(making them “Collaborators”)

the Inversion of Control container

assembles the Dependent and the Provider,

injects the Provider into the Dependent

gives you the possibility of selecting which Provider

implementation to inject into each Dependent

(by configuration, code or automatically (autowiring))

Page 43: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Inversion of Control (2/5)

WeatherPortlet

<<interface>>

WeatherService

YahooWeatherService WeatherComService

IoC

Container

Page 44: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

MVC pattern

Page 45: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

45

Model-View-Controller pattern goals

there are often many ways to present the same problem

requirements on how a problem is displayed tend to change

(i.e., “experimentation” goes on)

the MVC design tries to separate the code that represents

the problem from the code that presents the problem to the

user

this allows the “presentation” part to be change more

easily

this “pattern” arose because management has so often

demanded that programmers modify presentation

without the correct design, that’s “hard”

with this pattern, it becomes much “easier”

Page 46: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

46

the three roles

the Model contains data that represents the problem

the Controller responds to user actions by telling the Model how to change

the View displays the current state of the Model to the user

Page 47: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Front Controller Pattern

User

A

B

C

access

users access multiple resources, but there isn’t a common entry point

Problem: Java code or jsps

Page 48: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Problem

How to code common code to all requests like:

Dispatching to a view

Authorization: the user can or cannot access

the resource ?

Session handling

Parsing parameters common to all requests

…..

Page 49: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Front Controller

User

A

B

C

Access...

The front Controller is the controller which handle a generic request

Front Controller

Solutions:

Page 50: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Application Controller

Front controller is a common entry point

But how each request is mapped to the specific code

handling the user request ?

How the right view to be shown after a controller is

being executed is selected ?

In general: how to hook user requests to the right

action or render logic ?

Problem:

Page 51: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Application Controller

Users

view. A

Access Front Controller

delegates

delegates

View Controller

Action Controller

Act. X

Act. Y

view. B

Application Controller

Solution:

Page 52: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Spring MVC Architecture

Portlet Container

Dis

patc

he

rPort

let (S

pri

ng

)

ProcessAction

Render()

Handler Mapping (Spring)

1. Lookup action handler

4. Dispatch to a render controller

5. Return ModelAndView

Controllers (implemented by you)

View Resolver (Spring)

6. Looks up view resolver

Views (JSPs,… implemented by you)

7.Delegates rendering

Action Controller (implemented by you)

2. Dispatch to the action Controller

Handler Mapping (Spring)

3. Lookup render handler

Page 53: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Object-intensive app

Database

Other apps

ORM

Object-Relational Mapping (ORM)

• A software system that shuttles data back and forth between database rows and objects • Appears as a normal database user to the database • Can share the database and tables with other apps

53

Page 54: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

pizza_order

topping

pizza_size

id sizeid (FK) room status

order_topping

id name

orderid (FK) toppingid (FK)

id name

PizzaOrder Topping

PizzaSize

0..* 0..*

0..*

Classic Relationships

Schema mapping, entities to tables and vice versa

Needed database schema: has one table for each entity, plus a link table for N-N relationship

1

54

Page 55: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Inheritance Hierarchies

Both Hibernate and EDM can handle inheritance hierarchies and polymorphic associations to them

Both Hibernate and EDM provide single-table and multiple-tables per hierarchy solutions

Single-table: columns for all subtypes, null values if not appropriate to row’s subtype

Multiple-table: table for common (superclass) properties, table for each subclass for its specific properties, foreign key to top table

Also hybrid: common table plus separate tables for some subclasses

55

Option

Topping Shape

∙ color

∙ id

∙ name

∙ aspect

Page 56: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Aspect Oriented Programming (AOP)

Applications must be concerned with things like:

Transaction management

Logging

Security

Do these responsibilities belong to the

implementation classes?

Should a service class be responsible for

transaction management, logging, or security?

These concerns are often referred to as

“crosscutting” concerns

Page 57: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Transactions

A basic unit of consistent and reliable computing

in databases

One or multiple queries in one transaction

A sequence of databases reads and writes, and

computation

An execution of a program

Some reference:

http://static.springframework.org/spring/docs/1.

2.x/reference/transaction.html

Page 58: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

Declarative Transactions

Declarative transactional support can be added

to any bean by using

TransactionProxyFactoryBean

Similar to EJB, transaction attributes may be

defined on a per-method basis

Also allows definition of pre- and post-

interceptors (e.g. for security)

Page 59: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

59

Transaction Support (2)

Caller: are your controllers Proxy: ReservationService. acts like the target Target: ReservationServiceTarget real implementation

Page 60: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

60 07/06/2013 60

What is Ajax?

Diagram from: http://www.codeproject.com/KB/showcase/FarPointAJAX.aspx

Page 61: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment

07/06/2013 61

Ajax Example

07/06/2013 61

<body>

<script type="text/javascript">

function ajaxFunction(myStr) {

var xmlHttp;

try {

...

} // end of try section

xmlHttp.onreadystatechange=function() {

if(xmlHttp.readyState==4) {

document.getElementById('myElem').innerHTML =

xmlHttp.responseText;

}

}

$path = "http://www.cs.kent.ac.uk/people/staff/amlf/";

xmlHttp.open("GET",

$path + "reverse.php?str=" + myStr, true);

xmlHttp.send(null);

}

</script>

<!–- form goes here -->

</body>

Page 62: 12- Exam Procedure And course summaryunibz.ectrldev.com/awslab13/12-ExamProcedureAndSummary.pdf · Instruction on how to install the app (sql scripts if needed, settings) ... Deployment