Скачать презентацию COM DCOM COM Qisheng Hong Yani Mulyani Paul Скачать презентацию COM DCOM COM Qisheng Hong Yani Mulyani Paul

6fb036d8642680c065449a25a0b5f3d0.ppt

  • Количество слайдов: 28

COM/DCOM & COM+ Qisheng Hong Yani Mulyani Paul Visokey COM/DCOM & COM+ Qisheng Hong Yani Mulyani Paul Visokey

Outline The Component Object Model - COM DCOM COM+ Outline The Component Object Model - COM DCOM COM+

What is COM? Build software from parts, not from scratch A framework for creating What is COM? Build software from parts, not from scratch A framework for creating and using components n n n Both a specification and an implementation Makes software easier to write and reuse Provides widest choice in services, tools, languages, and applications Evolved from Object Linking and Embedding technology Foundation in OLE Version 2, 1995

Isn’t COM about “Objects”? No … COM sets out to solve system software problems Isn’t COM about “Objects”? No … COM sets out to solve system software problems that arise when hooking up randomly evolving combinations of binaries n Benefits stem from its design an an integration and deployment architecture for software components Yes … from the perspective of these new kinds of objects, also called “components” n n COM is about clients communicating with objects COM based applications can be constructed using languageindependent components

COM Architecture The Model The “ORB” The Services COM Architecture The Model The “ORB” The Services

COM Fundamental Principles What the designers of COM were striving for. . . Binary COM Fundamental Principles What the designers of COM were striving for. . . Binary components n Any programming language Any location (in-process, crossmachine) n No centralized authority n Object orientation n n Interoperability Reusability Simplest model possible n n Enable extensibility, maintainability and adaptability Multi-tier architecture

The Component Object Model (COM) Components, Components n n Code reuse and off-the-shelf components The Component Object Model (COM) Components, Components n n Code reuse and off-the-shelf components Language independent notion of an object Rigorous Encapsulation at the binary level n n Black box -- no leakage of implementation details All object manipulation through strict interfaces Polymorphism n n n Define several different behaviors for a single object via multiple interfaces per class “Discoverable”: Query. Interface() IUnknown IDispatch COM Object IRobot

The Component Object Model (COM) Standard API n n Binary structure for the interface The Component Object Model (COM) Standard API n n Binary structure for the interface between client and object Compilers support Microsoft’s COM binary structure - language independence The point of contact is the run-time binary representation OS acts as central registry for objects Applications only know the function of the object Wire-level standard for location transparency

OOD and COM Table 1: Differences in design considerations between OOD and COM Object-Oriented OOD and COM Table 1: Differences in design considerations between OOD and COM Object-Oriented Design Assumptions Added COM Considerations Objects typically packaged in the same application (module) as client code Objects and clients typically in separate modules, both. EXEs and. DLLs Objects and clients run in a single process Objects and clients may run in different processes and on different machines Class (implementation) inheritance Interface inheritance (no implementation inheritance) Single interface per object (the object's class definition) Multiple interfaces per object Single client per object Multiple simultaneous clients per object 1: 1 relationships between clients and objects typical Many: Many relationships between clients and objects is common

The COM Object Request Broker The “model” is about how the technology is used The COM Object Request Broker The “model” is about how the technology is used The “ORB” is how it’s implemented n Microsoft calls it the COM Runtime Secure n Security is designed and built in. Not an option. Inherently Distributed Pluggable n n Security Transports Free! (Built-into Win 32 Platforms) n No separate client access license or expensive “developer” version

Structure of the COM “ORB” Components and Applications The COM Runtime Core Services (Automation, Structure of the COM “ORB” Components and Applications The COM Runtime Core Services (Automation, Monikers, Storage, Com. Cat, Data Transfer, IR) COM and Distributed COM Registry MS-RPC Pluggable Security (SSPI) Pluggable Transports TCP UDP IPX SPX HTTP ETC. NTLM DCE Kerberos ETC.

COM Runtime Architecture Flexible and extensible Pluggable Transports Proxy Other Component ORB TCP, UDP COM Runtime Architecture Flexible and extensible Pluggable Transports Proxy Other Component ORB TCP, UDP SPX, IPX Net BUI HTTP COM Runtime COM Client Server Machine COM Runtime Client Machine ORB Component

COM Runtime Architecture Flexible and extensible Pluggable Security Providers Proxy Other Component ORB NTLM COM Runtime Architecture Flexible and extensible Pluggable Security Providers Proxy Other Component ORB NTLM SSL, Certs. NT Kerberos DCE COM Runtime COM Client Server Machine COM Runtime Client Machine ORB Component

COM Runtime Architecture Client COM run time Security provider RPC Inprocess Protocol stack LPC COM Runtime Architecture Client COM run time Security provider RPC Inprocess Protocol stack LPC Component RPC Protocol stack Local DCOM networkprotocol Remote

Accessing COM Services In the same process Fast, direct links to server library Client Accessing COM Services In the same process Fast, direct links to server library Client On the same machine Fast, secure lightweight RPC Across machines Secure, reliable and flexible DCE-RPC based DCOM protocol Client Process Client Machine Client Component Server Process COM Component Server Machine DCE COM RPC Component

COM Limitations Lack of a common type system, each language involved in COM had COM Limitations Lack of a common type system, each language involved in COM had its own type system. n Architecture does not have perfect knowledge of the types. COM is hard to use. Reference counting, Microsoft IDL, Global Unique Identifiers (GUID), etc. require deep knowledge of COM specification from developers. COM is not robust enough for enterprise deployments. Services such as secure transactions, reliable communications, and load balancing are not integrated in COM.

DCOM: Multiple Network Transports Clients C O M TCP, UDP IPX, SPX HTTP C DCOM: Multiple Network Transports Clients C O M TCP, UDP IPX, SPX HTTP C O M Queued Client Machine Server Machine COM Object

DCOM: Flexible Security Clients C O M NT 4 Security TCP, UDP SSL/ IPX, DCOM: Flexible Security Clients C O M NT 4 Security TCP, UDP SSL/ IPX, SPX Certificates Kerberos HTTP IPSEC C O M Queued Client Machine Server Machine COM Object

What’s next? COM+ Evolutionary step, making it even easier to build and use components What’s next? COM+ Evolutionary step, making it even easier to build and use components Infrastructure in the system, not in the application Extensible services Preserves current investments in COM Provides benefits across languages and tools Less coding, more productivity

COM+ Strategy Transactions Data Binding Persistence Load Balancing Security In Memory Database Event Infrastructure COM+ Strategy Transactions Data Binding Persistence Load Balancing Security In Memory Database Event Infrastructure Ubiquitous Type Description Dynamic Invocation “No-Leak” Memory Mgmt Interception Tools Ubiquity Market Binary Standard

The COM+ MODEL COM+ is the next step in the evolution of the Microsoft® The COM+ MODEL COM+ is the next step in the evolution of the Microsoft® Component Object Model and Microsoft Transaction Server (MTS). COM+ handles many of the resource management tasks such as thread allocation and security. COM+ automatically makes applications more scalable by providing thread pooling, object pooling, and just-in-time object activation. COM+ protects data integrity by providing transaction support, even if a transaction spans multiple databases over a network.

The COM+ MODEL COM+ still provides a standard library, and objects and their clients The COM+ MODEL COM+ still provides a standard library, and objects and their clients still use it. COM+ hides calls to this library beneath the equivalent native functions in the programming language. n C++ programmers can use the standard new operator rather than Co. Create. Instance() to create a COM+ object. COM+ developers no longer need to define interfaces using IDL. n Object's interfaces defined using their programming language's syntax.

The COM+MODEL COM+ addresses another important but challenging problem in creating a languageindependent object The COM+MODEL COM+ addresses another important but challenging problem in creating a languageindependent object model: data types. n Different languages support different data types, which causes problems when passing parameters between objects written in different languages. COM+ allows implementation inheritance between COM+ objects running in the same process. COM objects do not support constructors, but COM+ objects do. n COM+ constructors even allow passing parameters, better integrating COM+ objects and the objects used by today's most popular object-oriented languages.

COM+ Philosophy Attribute-based Programming n n n Write your Logic Set Attributes Runtime Does COM+ Philosophy Attribute-based Programming n n n Write your Logic Set Attributes Runtime Does all the grungy stuff Interceptors deal with the object based on the Attributes Different Interceptors provide different extensible services at Runtime

The key to extensible services: Interception Key concept in “COM +” run-time Interceptors provide The key to extensible services: Interception Key concept in “COM +” run-time Interceptors provide automatic behavior at runtime based on the attribute set Interceptors assure that when a transactional object attempts to change data either all succeed or all fail and rollback Interception Events n n n Instance creation Method call and return, field access Force fail pre and post call Binding an instance to a reference Dynamically (re)define method

COM+ and Windows DNA For building next generation applications The Web • • • COM+ and Windows DNA For building next generation applications The Web • • • Easy to Deploy Graphical UI Dynamic The Windows PC • • • Rich application services Familiar UI for users Consistent management Windows DNA • Integrates client/server and the web • Services that work together • Open protocols and published interfaces COM+ Applications • Component-based • Flexible and dynamic • Built-in scalability • Preserve current investments • Extensible services

Summary COM is the most widely adopted object model in the world COM+ builds Summary COM is the most widely adopted object model in the world COM+ builds on the success of the Component Object Model Provides benefits across languages and tools Less code, more productivity Extensible services enabled by interception Provides the backbone to Windows DNA

Questions? Questions?