Cours 1 Architecture Web Introduction Tuan Loc Nguyen
Cours 1 : Architecture Web Introduction Tuan. Loc Nguyen 1
Objectif du cours Ø Objectif : l l Architecture, évolution du Web Tendances du Web Ø Pre-requis l l l HTML /HTTP My. SQL/Php/Apache SQL Server/ASP/IIS 2
Contenu 1. 2. 3. 4. Architecture Web et BD Architectures intelligentes & Script Web dans l’entreprise 3
1. Le World Wide Web Ø Système hypermédia distribué fonctionne sur TCP/IP l l Simple à utiliser : I. E, Netscape, Mozilla Portable Faible coût Mobilité • Sans frontière l Standard • HTTP, URL, HTML, XML l Distribué : Active. X, COM, CORBA, EJB, Web. Services 4
Modèle du Web (Cours 2) 5
Impact du Web Ø Client/serveur universel l Un seul outil pour la communication intra- et interentreprise • Intranet, extranet (les partenaires), internet (tous) • Accès aux bases de données Adopté par toute l’industrie du logiciel Nombreux produits, nombreux fournisseurs Ø De nombreux serveurs Web Information et services Ø Le fondement de la société de l’information Ø 6
Applications e-business E-business = utilisation professionnelle du Web – Au sein de l’entreprise : B 2 E – Avec les clients : B 2 C – Avec les partenaires : B 2 B Ø Applications majeures – Intranets – Portails d’information d’entreprise – Commerce électronique – Publication en ligne Ø 7
Intranet Ø Serveur Web pour les besoins internes de l’entreprise – Réseau privé avec accès sécurisé à Internet • firewalls – Utilisateurs connus l Ø Ø Services avancés : visio-conférence – Services internes Publication d’information et workflow Forum de discussion, email et groupware Réduit les coûts de communication et améliore l’efficacité Problème : – Intégration avec les sources de données de l’entreprise 8
Portail d’information d’entreprise Ø Porte d’accès à l’information de l’entreprise – Vue uniforme d’information agrégée à partir de sources de données hétérogènes Applications existantes Bases de données Systèmes documentaires – Pour des utilisateurs spécifiques Décideurs, employés, clients, fournisseurs Ø Problème : – Difficile d’accéder à toute l’information de l’entreprise – Confiance 9
E-commerce Ø Elimination des procédures manuelles (papier) entre les partenaires d’un commerce Ø Au minimum : B 2 C – Sites très connus, (Amazon. com, Dell Computers, etc. ) – Gestion de la relation client – Intégration avec les bases de données – Transactions électroniques sécurisées pour commander • Cartes de crédit, monnaie électronique, E-check – Pas d’automatisation du côté client Ø Pleine puissance : B 2 B – Intégration de la chaîne de distribution avec d’autres fournisseurs 10
Gestion d’information Gestion de l’information indépendamment de tout programme, y compris celui qui l’a créé. Ø Principe = indépendance des données – du stockage Présentation – de la présentation Ø Présentation Vue logique stockage 11
Fonctionnement du Web Pour consulter un document (ex: http: //serveur/page. html) 1. Le navigateur demande à son DNS (Domain Name Server) de lui renvoyer l’adresse IP du serveur demandé dans l’URL (Uniform Ressource Locator) 2. Le navigateur envoie une requête à l’adresse IP pour demander la page. html précisée dans l’URL. 3. le serveur envoie la page au client. 4. le navigateur interprète la page et l’affiche. HTTP : protocole de transfert permettant de demander un fichier au serveur ainsi qu’une description de types données associées. IP : Internet Protocol 12
2. Couplage BD et Web Pourquoi coupler ? Ø Deux domaines qui se sont développés indépendamment mais qui ont de nombreux points communs : - Ensemble important de données (modélisation, stockage, indexation) - Interrogation (langage déclaratif) - Multi-utilisateurs - Performances - Fiabilité 13
Données du Web Données hétérogènes, fortement corrélées, évoluant souvent Ø La gestion de ces données avec un SGF et un système d’exploitation pose des problèmes : Ø l l l gestion des liens difficile gestion de l’évolution (pas d’indépendance logique-physique) performances moyennes (pas ou peu d’index) 14
Apports des SGBD Gestion de gros volumes d’information Ø Bonnes performances d’accès (index, stockage, gestion du disque) Ø Fiabilité des données (cohérence, sûreté de fonctionnement, sûreté d’accès) Ø Partage et accès concurrents (transactions) Ø Productivité (indépendance physique-logique, réutilisation, outils) Ø Evolutivité (évolution du schéma) Ø Langage de requêtes et optimisation Ø 15
Accès base de données 1. Le client http lance une demande de page Web (URL statique ou dynamique) vers le serveur. URL dynamique : contient un appel au programme applicatif + paramètres. La connexion est fermée dès que le client obtient la réponse. 2. Le serveur http est en attente permanente. En cas de demande dynamique, il lance le programme applicatif avec les paramètres, en suivant un protocole : • CGI : Common Gateway Interface • ASP, ASPx, PHP, JSP 3. Le programme applicatif : a. extrait les données nécessaires du SGBD b. produit la page HTML incluant ces données 4. Le SGBD … fait son travail de SGBD (reçoit des requêtes et renvoie les résultats) Solutions du marché : Ø • solutions SGBD +/- intégrées (+ : Oracle, Informix, - : Sybase, DB 2) Ø • solutions + générales : ASP (MS-Windows), JSP (JAVA), … 16
Limitations du couplage HTML-BD Solutions propriétaires Ø Pas de protocole pour publier les données – SQL n’est pas conçu pour le Web Ø Pas de format d’échange de données standard : HTML est un format de présentation : – Mélange présentation et contenu – Pas de structure, pas de sémantique, pas de contrainte d’intégrité – Perd la structure (schéma) provenant de la BD Ø 17
Amélioration La règle d’or : le contenu doit être abstrait et indépendant du stockage et de la présentation – Permet l’intégration uniforme de données hétérogènes – Permet des applications dynamiques Ø l l La présentation peut être différente selon le médium, le temps, la requête ou le profil de l’utilisateur 18
Primary programming technology Low-level programming ( machine code, Assembler ) High-level programming ( Fortran, Cobol, Basic, …) Structured programming ( Pascal, C, C++, …) Object-Oriented Programming ( C++, Java, Delphi. . . ) Component Oriented Programming ( COM, Java. Beans, …) Component Oriented Web Programming ( C#, Forte Java, …) Service-Assemblage/Creation Programming ( Web Services…) 1950 1960 1970 1980 1990 2000 2010 2020 2030 2040 2050 2060 19
Primary programming - OS models Low-level programming ( IBM Mainframe OS ) High-level programming ( IBM Mainframe OS… ) Structured programming ( Unix … ) Object-Oriented Programming ( Unix, MS DOS, . . . ) Component Oriented Programming ( Windows, Unix, Linux, …) Component Oriented Web Programming ( Dot. NET, JEEE, …) Service-Assemblage/Creation Programming (…) 1950 1960 1970 1980 1990 2000 2010 2020 2030 2040 2050 2060 20
Intelligence dans l’architecture x-tiers PC Web browser HTTP/HTML Data echange Web browser HTTP/HTML Web services XML/SOAP Web server PC Databases Person to person (C 2 C) Application to person (B 2 C) Architecture 1 -tier Architecture 2 -tiers Web services Application to application (B 2 B/ B 2 C) Application to person+ (B 2 C) Architecture 3 -tiers Architecture “n-tiers” Evolution de l’architecture 21
XML pour l’échange de données universel Le langage XML (Extensible Markup Language) – Standard du W 3 C – Décrit le contenu, pas la présentation • Structure, type, schéma, requêtes, etc. – Une base forte : XML est un sous-ensemble de SGML – Fournit l’indépendance des données au stockage et à la présentation : supporte la règle d’or Ø Facilite l’échange de données entre applications Ø 22
Web Services Un Web Services est une ‘’unité logique applicative’’ accessible en utilisant les protocoles standard d’Internet, indépendamment de plate-forme et peut être réutilisé. Call semantic (message passing-RPC) Web Services UDDI (seek Web Services. Xlink/XPath) SOAP message (HTTP/XML) SOAP (how to call via XML) Web Services WSDL (call syntactic &semantic – XML Schema) 23
Page serveur dynamique Ø Script l l ASP PHP JSP Aspx 24
Couplage HTML-bases de données Serveur HTTP dynamique – Basé sur CGI – Serveur Web dédié aux BD Ø Oracle Web. DB, Versant. Web, etc. Ø Pages serveurs dynamiques – MS Active Server Page (ASP) – Java Server Page (JSP) – PHP, ASPx, Ø 25
Accès Base de donées Ø Script Ø Problème : l l Passer à l’échelle Solutions propriétaires 26
ASP (Active Server Page) Moteur de script (VB Script) <% %> ASP HTTP IIS COM HTML Composants ADO HTTP Serveur Web Windows (NT, Y 2 K) Base de Access SQL Server données … Browser HTML Presentation Business logic Data services 27
Active Server Pages Development flow HTML author Content, layout, design <HTML> <% Script writer Component invocation VB Script Expressions Systems developer Component and database development TSym=Request. Query. String("Ticker. Symbol") Set. NObj=Server. Create. Object("NASDAQ. Ticker. Obj") if NObj. Get. Company(TSym)=False then Server. Redirect("ticker/entryform. htm") %> <H 1>Today's trade summary for: <%=NObj. Company. Name%> </H 1> <TABLE> <TR><TD>Open</TD><TD>Close</TD><TD>Volume</TD></TR> <TR><TD><%=NObj. Open%> </TD> <%=NObj. Close%> <TD> </TD></TR> <%=NObj. Volume%> </TABLE> <H 2>Time of report: <%=time()%> <%=date()%> </H 2> </HTML> NASDAQ 28
PHP Hypertext Preprocessor Moteur de script (PHP Script) <? php HTTP HTML Apache PHP (IIS) HTTP Fonctions My. SQL Serveur Web Windows (NT, Y 2 K, Linux) My. SQL Access Base de données … Browser HTML Presentation ? > Business logic Data services 29
ASP versus JSP Ø ASP – combinent HTML, VB Scripts et Active. X – efficace avec les Active. X Data Objects (ADO) • Interface DCOM pour l’accès BD via ODBC ou OLE-DB – Outils de développement intégrés JSP Ø JSP – Combinent HTML, Java et Java Beans – Accès aux composants EJB (serveurs) • Interface JDBC – Standard, proposé par tous les serveurs d’applications J 2 EE 30
Servlet - JSP Java Server Page “Now almost everyone using servlets has heard about Java Server Pages (JSP), a Sun-invented technology built on top of servlets. ” (Sun) -The programer write an out. println() call per HTML line, became a serious problem for real servlet use -Content creators had to ask developers to make all content changes 31
ASPx : une approche composant Ø ASP. NET l est basé sur un modèle composant coté serveur l repose sur le Framework. NET (coté serveur) l prend en compte les différentes capacités des navigateurs (support Java. Script, DHTML, …) l Ne nécessite rien de particulier sur le client Serveur Composants ASPX Client Html IE . NET Html Opéra 32
ASPx vs ASP/PHP classique Les pages ASP. NET sont compilées Ø Le contenu et le traitement sont séparés Ø Les développeurs et les graphistes peuvent, en standard, travailler indépendamment Ø ASP / PHP Un seul fichier code <balises> Form 1. asp ASP. NET Fichiers distincts / séparation logique code <balises> Form 1. aspx. vb Form 1. aspx 33
4. Web dans l’entreprise Serveur applicatif dans l’entreprise Simple = serveur Web – Petites applications, pas de transactions Ø Serveur d’entreprise = serveur Web + – Support des grandes applications, distribuées standard – Support des transactions – Support des composants – Support de XML – Outils de développement -> Création de services à valeur ajoutée Ø 34
Exemple : Web dans l’entreprise Call manager SGBD Serveur applicatif IP IP Environnement de Création de Services Réseau TCP/IP To. IP 35 24/32
Appel à partir du Web 2. SGBD Call manager 2’. Serveu Web (HTTP) Make Call 1. Serveur applicatif 3. Dial “ 351 -8567” Browser HTML 36
Accès aux données à distance via Web PC SGBD TPS lire données Serveur applicatif Réseau TCP/IP mettre à jour SGBD lire données mettre à jour Données : • Répertoire personnel : lire et MAJ • Profil de renvoi : lire et MAJ • Configuration de touches (une par une): lire et MAJ • Journal : lire 37
Appel Sortant / Appel Entrant Réseau téléphonique Call manager Serveur applicatif Réseau TCP/IP 38
- Slides: 38