Skip to the content.

Class-07

Domain modeling

It is used to generate a model in coding for a certain problem. The model should describe all the different entities along with their attributes and behaviors. In addition to the problem domain constraints. Each entity that stores value in properties and translatethe behavior in method is known as an Object Oriented Model.

Tips to follow when building your own domain models:

  1. When modeling a single entity that’ll have many instances, build self-contained objects with the same attributes and behaviors.
  2. Model its attributes with a constructor function that defines and initializes properties.
  3. Model its behaviors with small methods that focus on doing one job well.
  4. Create instances using the new keyword followed by a call to a constructor function.
  5. Store the newly created object in a variable so you can access its properties and methods from outside.
  6. Use the this variable within methods so you can access the object’s properties and methods from inside.

JavaScript

In order to create an object you have to use new keyword and the object constructor will create an empty object after that you could fill it with the properties and methods. You could also create Objects form the same type by calling the constructor function with the new keyword.

Updating the value of properties you have to use dot notation or square brackets. If you want to delete a property you could use Deletekeyword. Additionally ou can use Objects as an Arrays and vice versa.

Bulit-In Object

Bulit-In Object have three main group which is as the following:

  1. THE BROWSER OBJECT MODEL

BOM

  1. THE DOCUMENT OBJECT MODEL

DOM

  1. GLOBAL JAVASCRIPT OBJECTS

GJO


HTML

In order to create a table in HTML and adding it to the webpage you have to use <table>element. The table is consist of rows and each row is created with the <tr> element and each row have a number of cells which refrered to by <td> element.

table