DEV Community

Cover image for What is an Object Model
Humberto A Sanchez II
Humberto A Sanchez II

Posted on

What is an Object Model

Introduction

What is an object model? This document explores this medium to complex computer science topic. It first explains in plain english and then pictorially a simple real world model. It concludes with a more complex and purely abstract model invented by the internet.

Document Management

This source Libre Office document resides at the following URL: https://hsanchezii.wordpress.com

This document’s status is: Work-in-progress.

Acronyms

  • DOM - Document Object Model. This is the data representation of the objects that comprise the structure and content of a document on the web.

  • HTML - Hyper Text Markup Language. This is the language in which most websites are written. It is used to create web pages and make them functional.

What is an Object Model

An object model is a computer science mechanism employed in order to be able to define or replicate real world “things”, aka objects in terms that a computer program can understand and manipulate.


Real World Model

Let us suppose we wanted to build an object model for a book. See the figure "Simple Book Model". The way to read this is as follows:

  • A Book has a table of contents and chapters.
  • A Chapters has Paragraphs
  • A Paragraph has Sentences
  • Sentences have Words
  • Words consist of a fixed set of Letters

BookModel


The Internet's Document Object Model

The figure "Simple Web Dom" is a simplified and incomplete representation of an HTML DOM

It says:

  • A Documents consists of a Head tag and a Body tag
  • A Body may contain
    • Titles (realistically you only have a single Title tag)
    • Paragraphs
    • Tables
    • UnOrderLists
    • Divs
  • Tables consist of Rows
  • Rows consist of Table Rows and Table Data

SimpleWebDOM


Summary

With these simple examples you can see it is easy to think in terms of object models.

Top comments (0)