1 / 17

De DCOM à .Net

De DCOM à .Net. DCOM : Solution microsoft. Propriétaire Intégrée avec d'autres produits Microsoft (architecture DNA : Distributed Network Architecture) COM ActiveX MTS MQS Fonctionne sur plusieurs plates-formes NT/95 Unix. Le document. DDE : Dynamic Data Exchange

nen
Download Presentation

De DCOM à .Net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. De DCOM à .Net Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  2. DCOM : Solution microsoft • Propriétaire • Intégrée avec d'autres produits Microsoft (architecture DNA : Distributed Network Architecture) • COM • ActiveX • MTS • MQS • Fonctionne sur plusieurs plates-formes • NT/95 • Unix Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  3. Le document • DDE : Dynamic Data Exchange • Service de transmission de messages pour faire communiquer deux applications (1992) • Complexe uniquement implanté sur Excel • OLE1 : Object Linking & Embedding • Repose sur DDE • Copier/coller • OLE2 (1993) • Activation In-Situ Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  4. DCOM : Motivations • Développement et évolution d'applications réparties sur des machines hétérogènes • Mécanismes "transparents" d'appel à distance • Réutilisation de code • Réutilisation de composants binaires exécutables • Pas d'accès au code source • Association d'interfaces multiple à un composant binaire • Mécanisme de composition • Construction de composants à partir de composants existants • Evolution dynamique • Remplacement de composants (sans recompilation ou édition de liens) • Association de nouvelles interfaces • Capacité d'auto-description Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  5. DCOM: Distributed Component Object Model • DCE : Architecture distribuée • COM (Component Object Model) le modèle d'objet composant (1996) • Active-X: élément graphique actif que l'on peut assembler ou inclure dans des documents • DCOM: utilisation d’un modèle RPC de DCE pour les communications entre objets (1997) • (Ms)IDL: langage de définition d'interfaces • .net / DNA / Hailstorm Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  6. COM • Approche binaire des objets • Un objet COM : • publie une et une série d'interfaces • possède au moins une interface IUnknown • qui possède une méthode QueryInterface • qui possède des méthode de gestion du cycle de vie (Addref(), Release()) • chaque interface présente un GUID • 3 familles de composants • in-process, local, distant Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  7. COM est une fondation simple • Instanciation / Publication • Appels RPC • Contrôle de fonctionnement mémoire + • Nommage (moniker) • Stockage persistant • Transfert uniforme de données (flux) • Automation Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  8. La bibliothèque COM • Elle fournit une API pour la gestion des composants • Initialisation et terminaison • Allocation et libération de la mémoire • Génération des GUID (identificateurs uniques) • Accès à la base de registres (GUID <--> Noms) • Création des composants • Enregistrement des fabriques de classes • Bibliothèque pour emballage et déballage des paramètres Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  9. La base de registre • Base de donées permettant d'associer noms et GUID • CLSID -> Nom de fichier contenant le code d'implantation • {0003DF…098} --> C:\ProgramFiles\Internet\iexplore.exe • Nom familier(Progid)-->CLSID • Explorer.Appli_2-->{0003DF…098} • Autres fonctions de désignation et recherche • Informations sur configuration, usagers, etc… • Informations utiles pour la répartition (cf. DCOM) Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  10. COM, ActiveX et OLE ActiveX Documents Activation in situ Contrôles Liaison Documents composites Incorporation Glisser relâcher OLE COM Mise en script Transfert uniforme de données Monikers Stockage persistant Automation Modèle d'objet composant Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  11. DCOM CLIENT SERVEUR Application Cliente Souche COM Composant COM Proxy objet COM distant Proxy objet COM local Processus Client Exécutable COM Souche COM Composant COM Composant Sécurité DCE RPC Processus serveur Protocole de comm Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  12. CInsideDCOM • AddRef • Release • QueryInterface • Sum ISum Sum IUnknown AddRef Release QueryInterface IClassFactory Cfactory CreateInstance LockServer Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  13. Exemple de code import "unknwn.idl"; [object, uuid(10000001-0000-0000-0000-000000000001] interface Isum:Iunknown{ HRESULT Sum([in] int x, [in] int y, [out, retval]int * retval); }; Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  14. Les étapes d'appel d'un service • 1) Créer un composant (CLSID) • 2) Obtenir un pointeur d'interface (IID) • 3) Appel d'une méthode • fonction de l'interface • 4) Terminer • Gestion de la mémoire Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  15. Exemple de code client void main(){ Iunknown * pUnknown; Isum * pISum; HRESULT hr=CoInitialize(NULL); if(FAILED(hr)) cout << "CoInitialize failed."<<endl; const CLSID CLSID_InsideDCOM= {0x10000002,0x0000,0x0000,{0x00,0x00,0x00, 0x00,0x00,0x00,0x01}}; /*1*/ hr=CoCreateInstance(CLSID_InsideDCOM, NULL, CLSCTX_INPROC_SERVER, IID_Iunknown, (void**)&pUnknown); if (FAILED(hr)) cout << "CoCreateInstance failed."<<endl; /*2*/ hr=pUnknown->QueryInterface(IID_Isum, (void**)&pSum); if (FAILED(hr)) cout << "IID_Isum not supported."<<endl; pUnknown->Released(); int sum; /*3*/ hr=pSum->Sum(2,3,&sum); if(SUCCEED(hr)) cout << "Client: Calling Sum(2,3)= » << sum << endl; /*4*/ pSum->Released(); CoUninitialize(); } Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  16. Conclusion sur DCOM • Produit "propriétaire" • Lié à l'environnent Microsoft • Environnement de développement spécifique (Visual…) • Intégration aux autres outils • Office, Serveur Web IIS, IE, etc… • Interconnexion possible sur CORBA • Outil puissant, mais concepts difficiles à appréhender • Spécifications opaques • Héritage d'OLE • Nombreux composants diffusés • Windows / VB ... Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  17. Références • G. Eddon, H. Eddon, Au cœur de Distributed COM, Microsoft Press France, 1998 • R. Grimes, Professional DCOM Programming, Wrox Press, Canada, 1997 • Pointeurs • Microsoft • http://www.sente.ch/cetus/OO_ole.html • http://research.microsoft.com/~ymwang/papers/HTML/DCOMnCORBA/S.html • http://www.execpc.com/~gopalan/misc/compare.html Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

More Related