reading-notes

Readings: Object-Oriented Programming, HTML Tables

Domain Modeling

  1. Explain why we need domain modeling.
    • properly structure domain models can validate and verify the understanding of specific problem sets among various stakeholders,
    • as a communication tool they define a covaulary that can be used within and between both technical and business teams

HTML Table Basics

  1. Why should tables not be used for page layouts?
    • reduce accessibility
    • produce tag soup
    • not automatically responsive
  2. List and describe 3 different semantic HTML elements used in an HTML <table>
    • <th> table header cell: represents a cell within a table header. Defines the header of a column or row. provides context for screen readers and search engines
    • <caption> represents the title or caption of a table. A brief summary or title for the table describing its content.
    • <td> table data: represents a cell within a table that contains data. defines the content of a row or column within a table.

Introducing Constructors

  1. What is a constructor and what are some advantages to using it?
    • define the “shape” of an object; the set methods and the properties it can have; then create as many objects as we like, just by updating the values for the properties that are different.
    • allows us to eliminate the use of object literals when creating multiple objects.
  2. How does the term this differ when used in an object literal versus when used in a constructor?
    • this in an object literal is specific to that object ONLY
    • this in a constructor allows the creation of many objects that are also displaying uniquely

Object Prototypes Using a Constructor

  1. Explain prototypes and inheritance via an analogy from your previous work experience.
    • every function in JS has a prototype property that references an object.
      • prototyping allows us to share mthods across all instances of a function.
    • Inheritence is inherited from the parent object just like genetics, it isn’t exactly selected
    • Prototypes are traits specifically “bred” into the code for the object that are desirable and simplify/supercharge the objects