30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix G COM Integration 1341<br />

and the differences between its architecture and that of .<strong>NET</strong>. After reading this appendix,<br />

readers should have a basic understanding of COM and should be able <strong>to</strong> use COM components<br />

in .<strong>NET</strong> applications. To learn more about .<strong>NET</strong> and COM, consult the Web<br />

resources described in Section G.4.<br />

G.4 Internet and World Wide Web Resources<br />

www.microsoft.com/com<br />

The Microsoft COM Web page provides technical white papers, documentation and developer support.<br />

This Web page is an essential resource for COM developers.<br />

www.cs.umd.edu/~pugh/com<br />

This Web site presents a high-level technical overview of the COM architecture.<br />

msdn.microsoft.com/msdnmag/issues/01/08/Interop/Interop.asp<br />

This Web site provides an introduction <strong>to</strong> integration services provided in .<strong>NET</strong>. The Web site includes<br />

introduc<strong>to</strong>ry examples and describes .<strong>NET</strong>s COM interoperability capabilities.<br />

SUMMARY<br />

Initially, applications created for Windows or DOS were designed as single monolithic executables—entire<br />

applications packaged in single executable files.<br />

As applications grew larger and more complex, it became impractical for developers <strong>to</strong> construct<br />

and distribute all the necessary components of an application, which resulted in longer development<br />

times and more costly distribution mechanism.<br />

Microsoft incorporated dynamic link libraries (DLL) in Windows <strong>to</strong> allow developers <strong>to</strong> modularize<br />

and reuse code.<br />

A shared library, or dynamic link library, is a file containing compiled code that an application<br />

loads at execution time.<br />

Runtime loading allows developers <strong>to</strong> modify a single library and immediately test the results<br />

without rebuilding the entire application.<br />

Shared libraries increase the modularity of programs by allowing multiple applications <strong>to</strong> access<br />

a single code library.<br />

The partition of programs in<strong>to</strong> smaller “pieces” makes it easier <strong>to</strong> distribute application upgrades,<br />

because only those DLLs modified must be redistributed.<br />

Often, developers packaged DLLs with their applications <strong>to</strong> ensure that users were running the library<br />

version designed for their software. <strong>How</strong>ever, the packaged DLLs could overwrite preexisting<br />

libraries on users’ systems, possibly breaking previously installed software.<br />

The problems introduced by shared libraries were so difficult <strong>to</strong> locate and fix that their effects<br />

became known as “DLL hell.”<br />

In an attempt <strong>to</strong> combat “DLL hell,” Microsoft developed the Component Object Model (COM).<br />

COM is a specification that controls library versions, backwards compatibility and language interoperability.<br />

The COM specification, defined by Microsoft, is detailed and strict <strong>to</strong> ensure that COM developers<br />

create compatible libraries.<br />

Microsoft implemented the COM architecture on a large scale. Today, virtually all Windows libraries<br />

adhere <strong>to</strong> the COM specification.<br />

When implemented correctly, COM ensures highly organized and reusable libraries, but it does<br />

have limitations.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!