A continued look into Object-Oriented Programming.
Explain why we need domain modeling.
If I understand correctly, domain modeling is basically laying out a roadmap for the problem that a person or group wants to solve. Rather than jumping straight into possibe solutions, domain modeling can help teams anticipate problems and design more efficient and perhaps responsive code. It also serves as a reference point to help see the forest should a person or team get a little lost amongst the trees.
Why should tables not be used for page layouts?
Per the MDN web docs reading linked in this assignment, using tables for page layouts “reduces accessibilty for visually impaired users”, “produce tag soup”, and “are not automatically responsive” .
List and describe 3 different semantic HTML elements used in an HTML <table>.
<tr>: is used to create a row in a table,<td?>: is used to fill the cells of each row, and<th>: creates a header for the table.
What is a constructor and what are some advantages to using it?
A constructor is a function that helps to define the same property in multiple objects.
How does the term this differ when used in an object literal versus when used in a constructor?
In an object literal,
thisrefers to the property within the object. In a constructor,thisrefers to the parameters of the contructor function which become new properties in a specified object
Explain prototypes and inheritance via an analogy from your previous work experience.
*I guess this is sorta like contract negotiations between my employer and my union. Position updates are provided on proposed changes (ineritance), but anything not mentioned can be assumed to remain the same as the old contract (prototype).
Oh gosh… I’m not sure how much more I can handle, but maybe constructors? I wanted to figure out how to be less redundnat with my code in yesterday’s lab, and it seems that constructors are the way.