Chapter 3 -- The Fundamentals of COM

[Previous] [Next]

Chapter 3

This chapter describes the essential concepts and details of the Component Object Model (COM). It examines Microsoft's original motivation for creating COM and lays out the original design goals. As you'll see, COM connects clients to objects using the principles of interface-based programming. At the physical level, many details must be addressed when code for an application is distributed in separate binary files and client-object interaction takes place across process and host boundaries.

This chapter explains how COM's architects were able to integrate many languages, including Microsoft Visual Basic, into COM. You'll see how the Visual Basic compiler works with a special type of file called a type library. Type libraries make it possible for languages such as Visual Basic to access COM objects. You'll see how and why the Visual Basic compiler builds a type library into every ActiveX DLL and ActiveX EXE. This chapter also explains how scripting clients such as VBScript and JavaScript can access COM objects by using a mechanism known as automation.

In COM, the code written for clients and the code for components are often compiled into separate binary files. Components never expose their implementation details to clients, but clients still need to create objects. But how can a client application create an object if the object's server doesn't expose a visible concrete class definition? COM provides a class-loading mechanism that clients can call upon to create and activate objects without ever knowing about a component's implementation details. This chapter explains the services and design requirements that make object activation possible.

Finally, this chapter examines how clients communicate with objects that live in different processes and on different machines. COM's remoting layer solves a very difficult problem: How do you remote a method call across thread, process, and host boundaries? The architecture of classic COM not only solves this problem, it does so in a way that is completely transparent to the majority of application programmers.



Programming Distributed Applications with COM+ and Microsoft Visual Basic 6.0
Programming Distributed Applications with Com and Microsoft Visual Basic 6.0 (Programming/Visual Basic)
ISBN: 1572319615
EAN: 2147483647
Year: 2000
Pages: 70
Authors: Ted Pattison

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net