Rabu, 09 Juni 2010

PENGANTAR TEKNOLOGI WEB 2

PENGANTAR TEKNOLOGI WEB 2

WEB ARCHITECTURES & TECHNOLOGIES

ANTONIUS RACHMAT C

WWW

Software

Kumpulan service Internet, yaitu web-web yang berada di layer aplikasi

Ditemukan oleh Tim Berners-Lee dkk di CERN

Didesain untuk membantu para ilmuwan di CERN untuk memperoleh informasi dari dokumen-dokumen di Internet

Tujuannya: membuat software (browser) untuk menampilkan informasi tersebut

Idenya: hyperlink

WWW

The world wide web consortium (W3C) definition of the web: "The World Wide Web is the universe of network-accessible information, an embodiment of human knowledge"

Provides information access in ways not previously possible

Hyperlinked (Hypertext)

Graphical user interface

Pictorial and non-text information

Information that changes rapidly

Immediate access

Anyone can author a web site

Multi-user access to the same information (try that with a book)

Easily searchable information

WWW Computer

Structural Components

Clients/browsers – to dominant implementations

Servers – run on sophisticated hardware

Caches – many interesting implementations

Internet – the global infrastructure which facilitates data transfer

Semantic Components

Hyper Text Transfer Protocol (HTTP)

Hyper Text Markup Language (HTML)

eXtensible Markup Language (XML)

Uniform Resource Identifiers (URIs)

Web Server survey (netcraft)

Growth of World Wide Web

A brief history of the web

Web Architecture

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

Tiers…?

A “tier” can be hardware, software, or logical. The last is the most sensible option from an architectural viewpoint.

Therefore:

A non-application-specific client (such as a web browser) is not a tier

A database with no overlying data access layer is not really considered a tier either

N-tier web architectures

How to build a 2-tier web app…

How to build a 3-tier web app…

Physical architecture

Conceptual architecture

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

How do we design it?

The Model is a class that represents the actual problem being solved

it has private fields, and provides accessor (getter and setter) methods

the Model should always be a separate class

If using a GUI

the listeners collectively are the Controller

the displayed components are the View

the Controller and View are thus a little bit interdependent

Combining Controller and View

Sometimes the Controller and View are combined, especially in small programs

Combining the Controller and View is appropriate if they are very interdependent

The Model should always be independent

Never mix Model code with GUI code!

why?

ANSWER: you may be required to change the View

if you keep View and Model separate, changing the View will be relatively simple

MVC

Contoh

MVC Separation

Separating the presentation from the model

Presentasi dan model memiliki fokus yang berbeda:

presentasi ke tampilan, model ke data.

Perbedaan ketergantungan:

presentasi bergantung pada model tapi tidak sebaliknya.

Sehingga dapat mengembangkan multiple presentation dengan model yang sama

Separating the controller from the view

Contoh: .NET Web application

File: *.aspx dan *.aspx.vb

Contoh: PHP Zend Framework, Code Igniter

Kelebihan & Kekurangan Aplikasi Web


Teknologi Aplikasi Web

Bagaimana web bekerja?

Web application

Planning A Web site

Purpose

Purpose and Goal

Target Audience

New Web Technologies

Web site comparison

Content

Value-added contents

Text

Images

Color Palette

Multimedia

PENGANTAR TEKNOLOGI WEB 1

PENGANTAR TEKNOLOGI WEB

Pengantar Internet (HTTP)
Antonius Rachmat C

LAN
• LAN consists of the following components:
– LAN file server is a repository of various software and data files for the network (optional)
– Nodes are the client machines on the LAN
– Wired or wireless communication media that connects the devices
• LAN network interface card (NIC) is a special adapter that links an individual device to the communication medium and specifies:
– The rate of data transmission;
– The size of the message units;
– Addressing information attached to each message
– The network topology

WAN + Wireless
• Wide area networks (WANs) are networks that cover large geographic areas.
– WANs typically connect multiple LANs
– WANs have large capacity and combine multiple channels (fiber optic, satellite, microwave, etc.)
– WANs are provided by common carriers, such as telephone companies (Sprint, AT&T, etc.)
• Wireless:
– Wifi - simple wireless networks
– WLAN - expanding the wireless connection
– WiMax - Long-range wireless
What is Internet?


Intranet vs Extranet
• Intranet: is a private enterprise network for information gathering and distribution within an organization.
• Extranet: is a community of interest created by extending an intranet to selected entities external to an organization.

Internet
• Inter-connections network
√ Memiliki bnyk sub network
√ Komputer yg berbeda-beda, media penghubung yg berbeda-beda = heterogen
• Internet = hardware, WWW (web) = software
• Beberapa komponen:
√ Router, client, server, modem, DNS, protocol, TCP/IP


Internet
• Router: hardware yang mengatur jalur data sebuah paket (message)
• Client: bagian yg meminta layanan ke server
• Server: bagian yg melayani client (response)
• Modem (modulator/demodulator):
– Modulator merupakan bagian yang mengubah sinyal informasi kedalam sinyal pembawa (Carrier) dan siap untuk dikirimkan.
– Demodulator adalah bagian yang memisahkan sinyal informasi (yang berisi data atau pesan) dari sinyal pembawa (carrier) yang diterima sehingga informasi tersebut dapat diterima dengan baik.

• DNS : Domain Name Services
– Mengasosiasikan setiap node (komputer) yg terhubung ke Internet dengan sebuah nama yg “human readable”
– Mis: 202.134.201.137 => google.com
• Protocol: aturan komunikasi data
• TCP/IP: Transmission Control Protocol / Internet Protocol
– Protocol untuk Internet

• TCP: mengatur transmisi data
– Data dibagi menjadi paket2 kecil (~1.5kb)
– Paket tsb dikirim lwt router
• IP: menerjemahkan aturan dari satu network ke network yg lain
– Memungkinkan antar jaringan berbeda saling berkomunikasi





Penjelasan
• Protokol application layer: bertanggung jawab untuk menyediakan akses kepada aplikasi terhadap layanan jaringan TCP/IP.
• Protokol host to network: berguna untuk membuat komunikasi menggunakan sesi koneksi yang bersifat connection-oriented atau broadcast yang bersifat connectionless.

Penjelasan
• Protokol lapisan network: bertanggung jawab untuk melakukan pemetaan (routing) dan enkapsulasi paket-paket data jaringan menjadi paket-paket IP.
• Protokol lapisan physical: bertanggung jawab untuk meletakkan frame-frame jaringan di atas media jaringan yang digunakan.




Sejarah Internet

Internet di Indonesia

Domain
• Adalah alamat permanen situs di dunia internet
• Identifikasi sebuah situs Istilah yang umum digunakan adalah URL.
http://www.fppti.or.id
http://www.ipi.or.id
http://www.iwapi-jabar.or.id

Generic Domains
Tata Nama

• xxx.com : commercial
http://www.kompas.com
• xxx.edu : dunia pendidikan
http://www.upi.edu
• xxx.ac.id : pendidikan
• xxx.go.id : pemerintahan
http://www.bandung.go.id
• xxx.or.id :organisasi non profit
http://www.ipi.or.id

Country-Specific Domains
• Berektensi dua huruf second level domain)
- Indonesia berekstensi id
http://www.itb.ac.id
- Australia au
http://nla.gov.au
- Jepang berekstensi .jp
http://www.jla.or.jp
• Di Indonesia: dikenal dengan domain-co.id, .ac.id, .go.id, .mil.id, .or.id

Types of Websites
• Portal Web site- www.yahoo.com
• News Web site- www.cnn.com
• Informational web site- www.smidec.gov.my
• Business/ Marketing web site- www.kraft.com
• Educational website- www.resepi.mesra.net
• Entertainment web site- www.shockwave.com
• Advocacy web site- www.hsus.org
• Personal web site- www.ukm.my/radzuan
• Blog

HTTP
• Hypertext Transport Protocol (RFC 1945)
• Tim Berners-Lee, 1991
• Language of the Web
– Protocol yang digunakan untuk komunikasi antara web browsers dan web servers
– Since 1990
• TCP port 80
• Penyempurnaan HTTP 1.0 menjadi versi 1.1 dispesifikasikan oleh IETF dengan RFC 2616
• HTTP merupakan implementasi dari protokol TCP
• Bersifat “Stateless”
– Tidak ada informasi yang disimpan
– Solusi? Cookies & Session

HTTP (2)
• HTTP bersifat request – response:
– HTTP client (user agent misalnya) mengirimkan permintaan (request) ke HTTP server dan server meresponse sesuai request tersebut
• User agent: Mozilla, Netscape, Microsoft Internet Explorer atau browser berbasis teks, Lynx atau links
• Perbedaan mendasar antara HTTP/1.1 dengan HTTP/1.0 adalah penggunaan hubungan persistent.
• HTTP/1.0 membuka satu koneksi untuk tiap permintaan URI
– header = Connection: close
• HTTP/1.1 dapat menggunakan sebuah koneksi TCP untuk beberapa permintaan URI (persistent)
– header = Connection: Keep-Alive
– kecuali jika client menyatakan tidak hendak menggunakan hubungan persistent (header = Connection: close).

HTTP Client (Browser)
• NCSA Mosaic (M. Andreesen)
• Netscape Navigator (M. Andreesen)
• Microsoft Internet Explorer
• Browser Wars of the 1990's
• Mozilla (Netscape Open Sourced)
• Now Mozilla Firefox
• Apple Safari (from Konqueror)
• Others (Opera, Lynx)

Universal Resource Location (URL)

Universal Resource Location (URL)


Universal Resource Location (URL)


Universal Resource Location (URL)

URL Path = File System Path
• URL Path “/” maps to Document Root
• Let’s say Document Root is C:\htdocs\
/ => C:\htdocs\
/images/ => C:\htdocs\images\
/a/X.html => C:\htdocs\a\X.html
HTTP 1.0 is Stateless
• Each request/response pair uses its own connection; doesn't know about other pairs
• "One-Shot"
– Server Fulfills Request, and closes connection
+ Simple
─ Hard to design pages that are "logically connected" (e.g. Amazon checkout)

What is the URL path?
• http://foo.com:8080/a/b/bar.html?hello.there#binky
• query begins with ?
– hello.there
• fragment begins with #
– binky
• So, path is between host and query/fragment
– /a/b/bar.html
• But Request-Line includes Query

Fragment
• Used by client side to scroll to named anchors
...
• http://foo.com/b.html#Chapter1

Request String
• The path & query part of the URL
• NOT the fragment part
• http://foo.com/dir/b.html?info=extra&hello
– /dir/b.html?info=extra&hello is the Request String

HTTP Request Messages
• GET – retrieve document specified by URL
• PUT – store specified document under given URL
• HEAD – retrieve info. about document specified by URL
• POST – give information (eg. annotation) to the server
• DELETE – remove document specified by URL
• CONNECT – for use by caches

Example Request / Response
• Client requests
http://solaria.stanford.edu/food/index.html
• Client sends
GET /food/index.html HTTP/1.0\r\n\r\n
• Server sees request with path /food/index.html
• Server maps onto Document Root
G:/webroot + /food/index.html
• Server sends back file over HTTP (e.g. HTML file)

Method: Head
• Gunakan Tantlet

Hasil

Method: GET
• Buat file cobaget.php

GET
• Ketik perintah berikut:

Method : POST


Hasil POST


HTTP Response Codes
• 1xx – Informational – request received, processing
• 2xx – Success – action received, understood, accepted
• 3xx – Redirection – further action necessary
• 4xx – Client Error – bad syntax or cannot be fulfilled
• 5xx – Server Error – server failed