Está en la página 1de 24

Architecture J2EE.

Objectifs attendus
g

Serveurs dapplications J2EE


g

Systmes distribus

Architectures J2EE gNormes J2EE


couches logicielles, n-Tiers g framework J2EE et design patterns
g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p1

Objectifs atteindre .
g

Rpondre la question
g

quest ce que larchitecture J2EE ? raliser une application J2EE dans projet de 40h par quipe de 4

Mettre en Pratique :
g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p2

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 1

Cible J2EE.
J2EE , pour quelle informatique? g Quest-ce quun serveur dapplications J2EE ?
g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p3

Systmes distribus.
g

Division des traitements en modules indpendants


g g g

plus disponible plus volutif plus maintenable

Systmes distribus : petits, rapides et facilement adaptables

Systmes monolithique : gros, lents et inadaptables

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p4

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 2

Systmes distribus.
g

Disponibilit
g g

Dfinition Haute disponibilit Dfinition Capacits de traitement Dfinition Solution

volutivit
g g

Maintenabilit
g g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p5

Serveurs d'applications J2EE.


g

Le serveur d application
g

Collection de services mis disposition des applications


Serveur d'application Web Container EJB Container

Application Cliente
HTTP SSL

Servlet

JSP

EJB

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p6

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 3

JAX-RPC

JAX-RPC

Java Mail

Java Mail

RMI-IIOP

RMI-IIOP

JDBC

JDBC

JAXP

JAXP

JNDI

JNDI

JMS

JMS

JTA

JTA

Base de donnes

Serveurs d'applications J2EE.


g

Architecture Web

Base de donnes Client Web Firewall Serveur Web DMZ Firewall Serveur d'application

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p7

Serveurs d'applications J2EE.


g

Client Web
g g g

un navigateur interprte les pages HTML ou XML excute les applets ou du code JavaScript possde diffrents niveaux de scurit configurable peut interagir avec un serveur d application via HTTP

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p8

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 4

Serveurs d'applications J2EE.


g

Application cliente
g g

applications autre quun navigateur communique via JRMP, IIOP, TCP/IP, ...

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p9

Serveurs d'applications J2EE.


g

Serveur Web
g g g g

fourni du contenu Web (HTML, ) communique via HTTP, ... traite des requtes CGI peut tre un proxy frontal d un serveur d applications

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p10

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 5

Serveurs d'applications J2EE.


g

Machine
g

machine physique sur laquelle est install une ou plusieurs instances de WebLogic Server diffrence entre les machines UNIX et machines nonUNIX (NT)

Machine 1 NT

Machine 2 UNIX

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p11

Serveurs d'applications J2EE.


g

Serveur
g

g g g

une instance de la classe weblogic.Server dans une JVM associ une seule machine physique a une quantit de mmoire ddie MACHINE multi-tches
S1

S2

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p12

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 6

Serveurs d'applications J2EE.


g

Cluster
g

groupe de serveurs (rpartis sur des machines) vu comme une seule unit utilis pour assurer la distribution de charges et la reprise sur incidents DOMAINE
MACHINE 1 S1 MACHINE 2 CLUSTER

S2

S3

S4
sans machine explicite

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p13

Apport des serveurs d'applications. (1/2)


g

Permettent d'excuter des composants


g g g

Conformes aux technologies J2EE Indpendants du visuel et de l accs aux donnes D ployables dans un environnement
g g

extensible en puissance, scalabilit Indpendant de la plate-forte matrielle

Le composant le plus volu est un Enterprise Java Bean

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p14

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 7

Apport des serveurs d'applications. (2/2)


g

Services d'administration
g g g g

Dploiement de servlets et de composants Structuration en serveur, application Gestion d'annuaires JNDI Gestion de Pools et de Data sources Au niveau de chaque composant Au niveau de chaque mthode

Modle de scurit applicable


g g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p15

Implmentation de Serveurs d'applications J2EE.


g

Gamme WebLogic
g

WebLogic Server 9
g

Compatible J2EE 1.4

Gamme IBM WebSphere


g

WebSphere V6
g

Compatible J2EE 1.4

Gamme OpenSource
g

JBoss AS v4.0.2
g

Compatible J2EE 1.4, EJB3

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p16

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 8

Architecture de WebSphere 4/J2EE 1.3

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p17

Web administrative console

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p18

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 9

Ressources.
g

Site Sun sur J2EE


g

http://java.sun.com/j2ee/

Site BEA sur J2EE


g

http://dev2dev.bea.com/products/wlserver81/index.jsp

Your J2EE Community


g

http://www.theserverside.com/

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p19

Fin Prsentation J2EE.


g

Ce quil faut retenir :


Systmes distribus : disponible, volutif et maintenable g Normes J2EE : des nombreuses technologies JAVA qui voluent g Serveur dapplication J2EE : un web container, un EJB container et une collection de services mis disposition des applications
g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p20

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 10

Architecture J2EE.
g

Normes J2EE
g

Les principales technologies J2EE


g

Dveloppement distribu J2EE


n tiers, n couches logicielles, design Patterns

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p21

Normes J(2)EE.
g

Dfinition de Java 2 Platform Entreprise Edition (J2EE) Les applications dployes avec J2EE
g g g g

adhrent aux standards J2EE suivent les spcifications J2EE sont crites en Java sont dployables sur tous les serveurs implmentant J2EE

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p22

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 11

Architecture J2EE.
g

Une application J2EE se compose de

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p23

Architecture J2EE.
g

Une architecture J2EE se dcompose en n-tiers :


g g g g

partie cliente un Web Container un EJB Container partie mtier

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p24

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 12

J2EE : 4 types de conteneur

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p25

Composants WebSphere
g

HTTP server
g g

External HTTP server IBM Plug-in HTTP travaille avec le HTTP Server pour transmettre les requtes de servlets/JSP lApplication Server
g g

Web container
Moteur de servlets JSP Hberge les Web modules dune application J2EE WAS 5 intgre un serveur HTTP de dveloppement Associer plusieurs noms logiques (pour un site Web) un nom de machine
g

Embedded HTTP server


g

Virtual hosts dfinition


g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p26

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 13

Web container

Moteur de servlet 2.3 et JSP 1.2

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p27

EJB container

EJB container
g

EJB modules selon la spcification EJB 2

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p28

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 14

Normes J2EE 1.3.


g

Un serveur d application J2EE 1.3 supporte les technologies JAVA


g g g g g g g

1 Java Data Base Connectivity 2.0 2 Java Naming Directory Interface 1.2 3 Remote Method Invocation (RMI-IIOP) 1.0 4 Java Interface Definition Language 5 Servlet 2.3 6 Java Server Pages 1.2 7 Enterprise Java Beans 2.0

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p29

Normes J2EE 1.3.


g

g g g g g g g g

8 Java Transaction Architecture / Java Transaction Service (JTA/JTS) 1.1 9 JavaMail 1.2 includes Java Activation Framework 1.0 10 Java Message Service (JMS) 1.0.2 11 eXtended Markup Language 12 Java API for XML Parsing (JAXP) 1.1 13 Java API for XML-Based RPC (JAX-RPC) 1.0 (Web Services) 14 J2EE Connector Architecture (JCA) 1.0 15 Java Management Extensions (JMX) 1.0 Et les services Web

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p30

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 15

Normes J2EE .
g

Java Data Base Connectivity (JDBC)


g g

interface d accs aux bases de donnes spcifications sur les liens entre API et pilote de la base donnes

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p31

Normes J2EE.
g

Java Naming & Directory Interface (JNDI)


g

API Java d accs au service de nommage et de rpertoires construit comme un pont vers des fournisseurs d annuaire (DNS, LDAP, )

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p32

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 16

Normes J2EE .
g

Servlets
g g

mcanisme de traitement de requtes/rponses servlets HTTP


g g g g

invoques par des requtes HTTP dployables sur un serveur Web leur rsultat est un flux HTML envoy au navigateur peuvent grer des donnes de niveau session

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p33

Normes J2EE .
g

Java Server Page (JSP)


g g

gnre des pages Web dynamiquement compose de :


g g g

code HTML pour la reprsentation des donnes directives JSP scriptlets (code Java insr dans la page JSP)

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p34

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 17

Normes J2EE .
g

Entreprise Java Beans (EJB)


g g g g g

composants distribus crits en Java fournissent des services distribuables et dployables rutilisables sur les diffrents serveurs d applications excuts dans un conteneur (EJB container) intrts des EJB :
g g g

distribution scurit transactionnel

WebLogic Server (>= 7.0) supporte les EJB 1.1 et les EJB 2.0

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p35

Normes J2EE .
g

Java Transaction API (JTA)


g g

API Java de gestion des transactions WebLogic Server supporte les transactions locales et distribues

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p36

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 18

Normes J2EE .
g

Java Message Service (JMS)


g g

API Java d accs un middleware de messagerie supporte :


g g g g

le domaine Point Point le domaine diteur/Abonn l acheminement garantie des messages les sessions transactionnelles

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p37

Normes J2EE .
g

Java Management Extension (JMX)


g g

g g

dfinit un standard de gestion d infrastructure en Java dissocie les lments administrs de l outil d administration les spcifications dcrivent les Mbeans l administration interne de WebLogic Server est base sur JMX

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p38

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 19

Sommaire
Architecture du framework J2EE

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p39

Dfinition des couches


g

Couche prsentation
g

Framework MVC Struts 1.1 Classes simple Java et design patterns Service
g g

Couche Application (Business Delegate Layer)


g

Couche mtier (Business Layer)


g

Mtier : contrleur mtier Technique

Objet Mtier persistant (EJBs) Liaison avec entrept de donnes Gestion des oprations CRUD : Create, Read, Update, Delete. Entrept des donnes de lapplication Schema modele physique de base de donnes, schema XML,

Couche d accs aux donnes (Persistance layer)


g g

Donnes (Physical Layer)


g g

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p40

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 20

Layered software architecture


g

Page Layout and Data Input Validation


g g

Page layout Local data input validation GUI logic


g

visible part of the application provides end users with graphical forms for entering and retrieving their data. validate the user input generates the GUI for different type of clients multi-channel solutions responsible for the business processes and workflow responsible for transforming data coming from the database into business objects, and vice-versa responsible for managing connection pools and access rights implementation of the data access logic through stored procedures For enterprise application, the persistent data layer is usually implemented as a relational database.

GUI Logic
g g

Business logic
g

Business Logic
g

Object-relational mapping
g

Object-relational Mapping
g

Data access logic


g

Data Access Logic


g

Stored procedures
g

Stored procedures (optional)


g

Persistent data
g
g

Persistent Data (database)

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p41

Applying architectural patterns


Web browser Application server

Page layout
HTML, DHTML, JavaScript, ActiveX, Applets
HTTP / HTTPS SOAP

GUI logic Business logic Object-relational mapping

Page layout Local data input validation GUI logic Business logic Object-relational mapping Data access logic

3 Web

tiers
Database server

Data access logic Web server IIS, ASP, COM, VB, ADO
ODBC driver

Stored procedures Persistent data

Page layout
Web browser

HTML, DHTML, JavaScript, ActiveX, Applets


HTTP / HTTPS SOAP

Stored procedures Persistent data

Web

4 tie rs

GUI logic
Web server

Web server IIS, ASP


DCOM / SOAP

Business logic Object-relational mapping Data access logic Application server, MTS, COM, VB, ADO
ODBC driver

Application server

Stored procedures

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p42

Database Server

Persistent data

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 21

Framework Software Architecture


STRUTS Presentation Layout GUI/Navigation Service EJB 2.0 Treatments Business logic Data Persistence

EJB BMP ou CMP User 1 User context and session management User context and session management

User 2

Business Service Business Service Facade Facade Stateless or Stateful Stateless or Stateful Session Session

Data access logic Data access logic

User 3

Technical Service Technical Service Session Stateless Session Stateless or MDB or MDB

User X

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p43

Vue gnrale Bnfice: favoriser le remploi


Faible rutilisation Niveaux Layers
g

Forte rutilisation Traitements Service Logique Mtier


Business objects

Prsentation Interface GUI/Navigation

Donnes Persistance

Remploi maximis Gestion multicanaux Stockage des donnes banalis Intgration simple sur le poste de travail

Contexte utilisateur et gestion session Contexte utilisateur et gestion session

Business Business Service Service Business Business Service Service Technical Technical Service Service Business Business Service Service

Data access logic Data access logic

Business objects

Business Business Service Service Technical Technical Service Service Business Business Service Service

Business objects

Context Session

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p44

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 22

Vue gnrale Patterns principaux utiliss


g

Business Delegate
(http://java.sun.com/blueprints/patterns/BusinessDelegate.html)
g

Reduce coupling between Web and Enterprise JavaBeansTM tiers


(http://java.sun.com/blueprints/patterns/DAO.html)

Data Access Object (DAO)


g

Abstract and encapsulate data access mechanisms


(http://java.sun.com/blueprints/patterns/ServiceLocator.html)

Service Locator
g

Simplify client access to enterprise business services


(http://java.sun.com/blueprints/patterns/SessionFacade.html)

Session Facade
g

Coordinate operations between multiple business objects in a workflow


(http://java.sun.com/blueprints/patterns/TransferObject.html)

Data Transfer Object


g

Transfer business data between tiers

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p45

Architecture J2EE.
g

Ce quil faut retenir :


Norme J2EE : ensemble de technologies JAVA (~15) qui voluent gDveloppement application J2EE distribue g 4 containers : applet, client, web, EJB g Application dentreprise J2EE (EAR) gstructure J2EE de rpertoires respecter gDclaration des modules qui la composent par descripteurs de dploiement XML :
g

application.xml, client-application.xml, web.xml, ejbjar.xml. gArchitecture n tiers, couches logicielles distribus gFramework J2EE et design patterns.
g
2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p47

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 23

Objectifs atteints.
g

Vous savez rpondre maintenant la question


g

quest ce que larchitecture J2EE ?

Vous allez le Mettre en Pratique : projet de 40h par quipe de 4


g

Animation : 30h encadrs partir du 8 mars 2006

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p48

Objectifs Module enseignement TD


g

Objectifs Module enseignement TD


g g g g

Mettre en uvre un serveur d applications J2EE Dcrire une architecture gnrale X-Net J2EE Utiliser les technologies J2EE 1.4 Prototyper une application J2EE 1.4

Pr requis initiaux
g g g g

Comprhension de la notation UML Connaissance des techniques de gestion de projet Programmation objet avec Java Dveloppement Web avec Java

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p49

2006/03/08 Eric Hbert.eheb@yahoo.fr / ifsic-DIC2-ARC-LSI-Architecture J2EE / p 24

También podría gustarte