开发者

difference between COM and DOM

Can anyone brief me the difference between Component object Model and Document Object Model and Elaborate what they are and how to 开发者_JAVA百科use them

thanks a million


COM (Component Object Model) is a cross-language programming model for the Microsoft Windows platform based on interfaces inheriting from a common ancestor (IUnknown) providing a way to create, and then dynamically discover and use various software libraries (the components).

For example, the whole Windows Shell is a set of COM libraries, and the Windows Explorer makes uses of components to extend its default capabilities, for example to add new toolbars, or provide property sheets for various file types.

COM is a rather complicated technology to learn, full of pitfalls, and heavily based on the Windows registry and GUIDs (like... {21EC2020-3AEA-1069-A2DD-08002B30309D}). It uses reference counting to handle the memory allocation and liberation of components. COM provides several ways to instanciate those components, the various "threading models".

I invite you to read the wikipedia entry for COM, as there is much more to be said about it: http://en.wikipedia.org/wiki/Component_Object_Model

DOM is a completely unrelated technology.

Web pages in browsers are built upon SGML, and now XML based-languages, the HTML family.

These languages are hierarchical in the sense that they are comprised of container tags that in turn contain other tags.

<html>
    <body>
        <img src="t.jpg" />
    </body>
</html>

The DOM (Document Object Model) is a standardized way of accessing this hierarchy via programming, either for reading, or for modification, usually by using languages like Javascript.

It also provides the various events that can be used to enhance web pages interactivity, like the "onclick", "onload" events...

The W3C has played a great role in standardizing this model, so that the various browsers can be (mostly) compatible and use the same javascript code to manipulate the DOM of pages.


COM is a form of IPC that runs on Microsoft Windows. DOM is a method for querying and manipulating HTML and XML documents.


Component Object Model is a Binary Interface standard for software introduced by Microsoft in 1993. it is used to enable inter-process communication object creation in a large range of programming languages. Com is the basis of several other Microsoft technologies and frameworks, including OLE, OLE Automation, Browser Helper object, ActiveX the Windows shell, DirectX, UMDF, and Windows Runtime.

The essence of COM is a language-neutral way of implementing objects that can be used in environments different from the one in which they were created even across machine boundaries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜