Class 7
Back to home page
Domain modeling
Q. Explain why we need domain modeling.
- Domain modeling is important because it can help identify any problems as well asdescribe the various entities, their attributes and beheviors.
HTML table basics
Q. Why should tables not be used for page layouts?
- It can make the table look messy and hard to read and debug, as well as making screen readers read information out weird for visually impaired people.
Q. List and describe 3 different semantic HTML elements used in an HTML table.
-
td, this will make a new cell in the table.
-
tr, this will add a new row to the table.
-
th, this will make a table header/footer.
Introducing Constructors
Q. What is a constructor and what are some advantages to using it?
- a constructor can make creating mass amounts of objects easier, and use the new command. Using a constructor is more concise and conventional than creating a new object and placing values into it one by one.
Q. How does the term this differ when used in an object literal versus when used in a constructor?
- It refers to the constructor code, so you can refer to it.
Object prototypes using constructors
Q. Explain prototypes and inheritance via an analogy from your previous work experience.
- I could compare departments to prototyping. Think of the company you work at as the object, and all the different departments are prototypes. Prototypes themselves are objects as well, and the same being each individual department. There are more and more levels in the department until you reach the standard worker. For me I worked in the produce department at Safeway, so it goes department, manager, assistant managers, shift leads, and standard workers. I am a standard worker so i am at the end of the prototype. Pretty much all objects have objects within them, and they will have prototypes until null is the prototype for a prototype.