top of page

DOM IN LIGHTING WEB COMPONENT PART 1

Writer's picture: SalesforceFresherSalesforceFresher

DOM and its history

Intent of coming up with a Document Object Model was to provide a standard programming Interface that be used in multiple different environments and applications. In short, Document Object Model originated as a specification to allow JavaScript scripts and Java programs to be portable among web browsers. The Document Object Model (DOM) is a programming API(Application Programming Interface) for HTML and XML documents. XML(eXtensible Markup Language) is more of a benchmark to store and manage a lot of data in wide variety of systems. This data is generally represented/addressed as “Document ” within the XML realms because of this very reason Document is used with a broader sense and hence DOM is prevalently used lingo. To summarise, Document Object Model is the framework which provides functionality to modify, create, delete, add ,access the data present within XML /HTML Documents.

The Name Document Object Model was chosen as it represents an Object Model on the principals of the Object Oriented Design Model. In other Word , Documents which are modeled using Objects, this doesn’t represent just the structure but also the functionality contained in it.

DOM and its structure

Document Objet Model has a tree structure, it resembles the hierarchical structure followed by either the HTML or XML document.

The Document Object Model comprises of the below:-

  • Objects used to represent a document and its related interfaces for manipulating this same document

  • Semantics of the

    • Objects and related attributes

    • Interfaces and related behaviours

  • Relationships amongst these interfaces and Objects


For instance, consider this table, taken from an HTML document:

<!DOCTYPE html>
<html class=e>
 <head><title>Aliens?</title></head>
 <body>Why yes.</body>
</html>

The Document Object Model represents this table like this:




Structural Isomorphism is a very distinct property with respect to Document Object Model (DOM), this property states that even if any two DOM implementation are used to create a representation of the same document, they will create the same DOM structures with precisely the same objects and relationships. This gives an insight in the structure of the individual documents which may have a their own unique hierarchical structures, the DOM would just imitate those structures and this might not even be similar to a tree(as depicted above) but would depend on the document and hence the complexity of such DOM structures may vary.

The Document Object Model currently consists of 3 parts, DOM Core, DOM XML and DOM HTML. The DOM Core provides foundation for the functionalities used for all documents, and also serves as the basis for DOM HTML & DOM XML.

18 views0 comments

Recent Posts

See All

コメント


bottom of page