reading-notes

Reading 7 - Object-Oriented Programming, HTML Tables

Source

Q1 Explain why we need domain modeling.

Source

Domain modeling is needed to create a conceptual model in code for a specific problem.

Q2 Why should tables not be used for page layouts?

  1. Pages laid out with layout tables make the page confusing for users that use screen readers.

  2. The code is more difficult to read, write, and maintain due to needing more complicated markup structure.

  3. HTML tables are difficult to style effectively, since the width is determined by the content.

Q3 List and describe 3 different semantic HTML elements used in an HTML <table>.

Source

Q4 What is a constructor and what are some advantages to using it?

A constructor is a function called using the new keyword. When a constructor function is called, it will create a new object. It is beneficial if you want to create many similar objects without repeating code.

Q5 How does the term this differ when used in an object literal versus when used in a constructor?

When this is used in an object literal, it refers to the object itself. When this is used in a constructor function, it refers to the newly-created object.

Source

Q6 Explain prototypes and inheritance via an analogy from your previous work experience.

I previously worked in a pharmaceutical development laboratory.

A prototype is like the USP (United States Pharmacopoeia), a reference containing a set of standardized procedures. This is a blueprint for performing commonly-performed tests.

A batch record for a new drug product is like an instance. Certain specifications (like the theoretical content in milligrams) will be unique for each drug product, but other tests (like the Uniformity of Dosage Units) are standardized and will come from the USP.

Things I want to know more about

Pretty much everything in the last reference. It is all good information with good examples that we covered breifly, but I definitely need to study more.