8. Quiz Questions

If you would like to look up the answers for the following quiz questions, you can check our discussion forum. If you don't find an answer in the forum, you may create a post asking for an answer to a particular question.

8.1. Question 1: Where to check constraints

Where in the application code should the constraints be checked? In the ...

☐ controller code

☐ model classes

☐ user interface code

☐ underlying DBMS (if it supports constraint validation)

8.2. Question 2: Where to define constraints

Where in the application code should the constraints be defined? In the ...

☐ controller code

☐ model classes

☐ user interface HTML5 code

☐ user interface JavaScript code

8.3. Question 3: Counting constraints

How many constraints are specified by the class model shown in the diagram?

Enter a number: _____

8.4. Question 4: Constraint names

Which of the following constraints are specified by the class model?

☐ A range constraint for the property name.

☐ A uniqueness constraint for the property name.

☐ A referential integrity constraint for the property name.

☐ A uniqueness constraint for the property age.

☐ A mandatory value constraint for the property name.

☐ A mandatory value constraint for the property age.

8.5. Question 5: Compliant objects

Which of the following objects do not represent admissible instances (or, in other words, violate a constraint) of the object type Person?

{name: "Susan", age: 8}

{name: " ", age: 0}

{name: "Susan"}

{name: "Peter", age: 122}