Chapter 14. Practice Projects

Table of Contents

1. Project 1 - Assigning a director and actors to a movie
2. Project 2 - Assigning a capital to a country, as well as members and a headquarter location to an organization

All projects include the following tasks:

  1. Make an association-free design model derived from the given design model. Hint: replace associations with corresponding reference properties.

  2. Make a JavaScript data model derived from the association-fee design model. Hint: add check and setter methods.

  3. Encode your JavaScript data model, following the guidelines of the tutorial.

Make sure that your pages comply with the XML syntax of HTML5, and that your JavaScript code complies with our Coding Guidelines and is checked with JSLint (http://www.jslint.com).

If you have any questions about how to carry out the following projects, you can ask them on our discussion forum.

If you would like to work on these practice projects with the guidance of a coach, then you should enrol in the advanced online course (book parts 4-5) offered by our partner developer-competence.com.

1. Project 1 - Assigning a director and actors to a movie

This project is based on the information design model shown below. The app from the previous assignments is to be extended by adding the possibility to manage data about the actors and the director of a movie. This is achieved by adding a model class Person and two unidirectional associations between Movie and Person:

  1. a many-to-one association assigning exactly one person as the director of a movie, and

  2. a many-to-many association assigning zero or more persons as the actors of a movie.

Figure 14.1. Two unidirectional associations between Movie and Person.

Two unidirectional associations between Movie and Person.

You can use the following sample data for testing your app:

Table 14.1. Movies

Movie ID Title Release date Director Actors
1 Pulp Fiction 1994-05-12 3 5, 6
2 Star Wars 1977-05-25 2 7, 8
3 Dangerous Liaisons 1988-12-16 1 9, 5

Table 14.2. People

Person ID Name
1 Stephen Frears
2 George Lucas
3 Quentin Tarantino
5 Uma Thurman
6 John Travolta
7 Ewan McGregor
8 Natalie Portman
9 Keanu Reeves

More movie data can be found on the IMDb website.