COM+ Component-Based Computing Environments
Total Page:16
File Type:pdf, Size:1020Kb
Application Servers G22.3033-011 Session 10 - Main Theme .Net/COM+ Component-Based Computing Environments Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda Web-Enabling Facilities (continued) Java Web Start (JWS) COM / DCOM Component Model and OLE COM+ MTS Services: Transactions and Security COM+ Message Queuing .Net/COM+ Integrated Services Enterprise Component Development with .Net/COM+ Designing .Net/COM+ Component-Based Architectures Summary Readings Assignment #7 (continued) 2 1 Summary of Previous Session J2EE Client Component Infrastructures (continued) CORBA 3 OMA Services CORBA 3 CCM CORBA 3 Environments Enterprise Component Development with CORBA 3 Designing CORBA 3 Component-Based Architectures Summary Readings Assignment #7 3 Application Servers Architectures Application Servers for Enhanced HTML (traditional) a.k.a., Page-Based Application Servers Mostly Used to Support Standalone Web Applications New Generation Page-Based Script-Oriented App. Servers First Generation Extensions (e.g., Microsoft IIS with COM+/ASP) Servlet/JSP Environments XSP Environment Can now be used as front-end to enterprise applications Hybrid development environments Distributed Object Computing Platforms Provide an infrastructure for distributed communications enabling Still need to merge traditional web-oriented computing with object computing Object Management Architectures DOC Platform + APIs to reusable services and facilities 4 OMAs+Client/Server Component Models -> J2EE, CCM, DNA 2 CORBA 3 References OpenCCM Documentation http://openccm.objectweb.org/doc/index.html Getting started with OpenCCM Tutorial http://openccm.objectweb.org/doc/0.5/tutorial_Getting_Started_with_OpenCCM.ppt OpenCCM Installation Guide http://openccm.objectweb.org/doc/0.8/install_guide.html OpenCCM 0.8 Download http://openccm.objectweb.org/download/index.html 5 Part I Microsoft Platform Architectures (includes slides covered in previous sessions) Also See: “http://www.execpc.com/~gopalan/misc/compare.html” “http://www.javacoffeebreak.com/articles/rmi_corba/” “http://www.quoininc.com/articles.html” 6 3 Microsoft Active Platform (Logical Architecture) 7 Microsoft Active Platform (Features) Logically centralized architecture Physically de-centralized architecture Scripting Client-Side: Improved user interface and data validation Server-Side: Business rules and data access VBScript and JavaScript built-in support PerlScript support via ActiveX scripting engine (e.g., ActiveState’s) Ability to mix scripting languages Active Server Components Provide OS services to ASPs Encapsulate business rules to ease programming e.g., TextStream Component (FileSystem object) 8 4 Microsoft Active Platform (Physical Architecture) 9 Microsoft Component Object Model (Logical Architecture) 10 5 11 12 6 13 14 7 15 COM IDL (stockMarket.idl) Example: [ uuid(7371a240-2e51-11d0-b4c1-444553540000), version(1.0) ] library SimpleStocks { importlib("stdole32.tlb"); [ uuid(BC4C0AB0-5A45-11d2-99C5-00A02414C655), dual ] interface IStockMarket : IDispatch { HRESULT get_price([in] BSTR p1, [out, retval] float * rtn); } 16 8 COM IDL (continued) Example: [ uuid(BC4C0AB3-5A45-11d2-99C5-00A02414C655), ] coclass StockMarket { interface IStockMarket; }; }; 17 18 9 19 DCOM Architecture Review 20 10 DCOM Object Activation/Method Invocation (top layer - basic programming architecture) 21 DCOM Object Activation/Method Invocation (middle layer - remoting architecture) 22 11 DCOM Object Activation/Method Invocation (bottom layer - wire protocol architecture) 23 24 12 COM+ See Session 4: Sub-Topic 3 Presentation on Introduction to CORBA, DCOM, and RMI See Session 5: Sub-Topic 3 on Introduction to .Net/C# Sub-Topic 4 on Building COM+ Applications 25 COM+ = DCOM/COM + MTS 26 13 DNA Web Architectures FORM+ = Merger of Win32 GUI and Web APIs (~DHTML) STORAGE+ = OLE DB COM+ = COM + MTS 27 Distributed InterNet Applications Architecture (DNA) 28 14 Microsoft DNA Environment (summary) See comparison of EJB and MTS models: http://members.tripod.com/gsraj/misc/ejbmts/ejbmtscomp.html Environment combines COM+ (DCOM+MTS) Component Model Win32/SCM and DCOM/COM+ Services Visual Studio Development Environment 29 Microsoft IIS with COM+/ASP Features IDE: Visual InterDev (ASP) Management of site development process Scripting Alternative IDEs Macromedia Drumbeat, Ultradev, Dreamweaver NetObjects Fusion Microsoft FrontPage 2000 Adobe GoLive Server Platforms Windows 2000/NT Use ChiliSoft for other platforms (http://www.chilisoft.net/) Platforms: Solaris, Linux, AIX, HP-UX, Windows Immunity from current IIS attacks (e.g., code red worms on Win 2000) Web Server: Apache, iPlanet Chili!Beans support for Java (similar to Microsoft with COM+ and ASP for C++) 30 15 Microsoft IIS with COM+/ASP Features See “Microsoft IIS, COM+, and ASP” in “Web Server Brains” COM+ / ASP Equivalent to J2EE EJB / JSP Included in Microsoft Windows 2000 Advanced Server COM+ Attributes (declare what runtime services are needed by the component) Threads and database connection pools (access via Active Data Object API) ASP Object Model sub-systems HTTP request COM+ transaction External COM+ components Other solution components: Visual Studio 6.0 Internet Security and Acceleration Server (ISA) static content caching, fault tolerance, load balancing, request handling 31 Microsoft .NET Platform Smart Devices + Windows XP + Web Services http://www.microsoft.com/net First set of Microsoft Web Services http://www.microsoft.com/net/hailstorm.asp 32 16 Part II Win32 and COM+ Services (includes slides covered in previous session and new ones) “http://members.tripod.com/gsraj/misc/ejbmts/ejbmtscomp.html and related archives” and Session 10 Sub-Topic 1 Presentation on “A COM+ Application Scenario” 33 DNA OMA Services Activation Services DCOM Activation Framework Naming and Directory Service DCOM Class and Object Naming (i.e., CLSIDs, ProgIDs, and Monikers) Trading Service Microsoft Active Directory Transaction Service COM+ MTS Messaging Service COM+ MSMQ 34 17 Win32 Services Win32 executable that satisfy several properties Lifetime is controlled by the Service Control Mgr (SCM) Service is registered with SCM, and understands and obeys SCM commands Service has its own login session or shares one with another service Service runs as a user or local system and abides to applicable security Service implements a set of service-specific functions: Starting up, message handler, communication back to SCM 35 COM+ Services COM+ Catalog (v.s. Windows Registry) COM+ Load Balancing COM+ In-Memory Database (IMDB) COM+ Object Pooling COM+ Queued Components COM+ Events C++ Compiler Changes 36 18 DCOM Class and Object Naming (file moniker file: bind) 37 DCOM Class and Object Naming (url moniker http:, ftp:, gopher: bind) 38 19 DCOM Class and Object Naming (class moniker clsid: bind) Display name for class monikers: display-name = "CLSID:" string-clsid-no-curly-braces *[";" clsid-options] ":" clsid-options = clsid-param "=" value clsid-param = none currently defined C++ example (tell moniker to use an object that can read a document instead of the document itself): ProgIDFromCLSID( &clsid, "xyz.activator.1") CreateClassMoniker( clsid, &pmkClass ) MkParseDisplayName( pcb, "\\northamerica\central\employee.doc", &dwEaten, pmkFile ) pmkFile->BindToObject( pcb, pmkClass, IID_IDispatch, &pDisp ) 39 COM+ Catalog v.s. Windows Registry Stores COM+ application attributes, class attributes, and computer-level attributes Guarantees consistency among attributes Provide common operations on top of attributes Two different stores COM+ registration database Microsoft Windows Registry (HKEY_CLASSES_ROOT) COM components that do not require new COM+ services Type library Interface proxy/stub registration Unified logical view via COM+ Admin Library 40 20 Microsoft Active Directory Maintains user, security, and network resource information used on a Windows 2000 network DCOM components can store their activation and connection information in the ADS COM objects can be exposed as APIs to ADS 41 Trading Service - Active Directory http://www.microsoft.com/windows2000/server/evaluation/features/dirlist.asp 42 21 COM+ Load Balancing 43 COM+ IMDB 44 22 MSMQ Messaging Upon queued component instantiation Local recorder proxy object is created As the client makes method calls Local recorder object serializes the calls into MSMQ messages Client commits the object by releasing all references to it Message is passed to the server via MSQM Special service running on the server de-queues messages and instantiate the component using a player proxy Upon failure A message is placed back on the queue Getting back to the client No response needed Response queues (asynchronous reporting) 45 Pass by value interface references COM+ Queued Components 46 23 Using COM+ Queued Components Svc. Example: IOrder* pOrder = 0; CoCreateInstance( CLSID_Order, ... IID_IOrder, (void**) &pOrder ); pOrder->put_Customer( 2000 ); pOrder->put_Quantity( 2 ); CComBSTR bstrSKU( "3535-2334" ); pOrder->put_SKU( bstrSKU ); long lOrderNumber; pOrder->Submit( &lOrderNumber ); pOrder->Release(); 47 COM Event Handling Mechanisms Events/Callbacks via client interface Client implements an interface defined by the component Uses Advise/Unadvise methods (see example in later slide) Events/notifications are handled via calls