Foundations of Software Engineering

Homework 6: MVC Model Associations

For this homework, you will further refine your team’s web app by adding associations between some of your previously created model classes and by updating your seed data and actions/views to use these associations. Additionally, you will continue to practice with the version-control system, Git.

You will do this homework as a team; however, each member of your team will be responsible for the completion of a particular task. Each team member will choose one task from the list below to complete. All team members must do a different task. If your team has only three members, then ignore Task 4.

The Tasks

Similar to previous homeworks, there will be four tasks (Tasks 1 through 4); however, this time the tasks are more inter-related. Each task will have the same four parts:

  1. Add two model associations.
  2. Add seed data that uses the associations.
  3. Update views/controllers to make use of the associations.
  4. Update the home page to link to your newly created pages.

Part 1: Add two model associations

Implement two one-to-many associations, as shown in the following figure. In particular, you must create the associations labeled with your task number. Your Rails model associations must match the class diagram exactly—including the role names on the association ends.

alt text

Part 2: Add seed data

Add seed data as follows. You must have at least three records from the “one” side of each of your associations, and each of those records must be associated with at least two records from the “many” side of the association. Thus, for a given association, there will need to be a minimum of 9 records (3 from the one side + 2 + 2 + 2 from the many side).

In creating the seed data, you may need to coordinate with your teammates to come up with sensible data given their constraints. To keep the total number of seed objects manageable, it is OK for you to “share” model objects with teammates in the seeds file. That is, you may count the same model object toward the objects required for multiple associations.

Part 3: Update views/controllers

Using your newly created associations, you must update views/controllers as per the task-specific requirements below:

Task 1

Task 2

Task 3

Task 4

Part 4: Update the home page

Update your project’s home page so that it now lists your name (no hyperlink) followed by the following two links:

Task 1

Task 2

Task 3

Task 4

How to submit your team’s work

Before you can submit, all team members must have merged their code into the master branch and pushed the updates to GitHub. If a team member does not complete his/her work on time, you may submit without his/her contribution.

To submit your team’s work, you must “tag” the current commit in the master branch:

To grade your work, I will check out the appropriate tag, and run it on my machine.

Note that if for some reason you need to update your submission, simply repeat the tagging process, but increment the version number (e.g., hw6v2, hw6v3, hw6v4, etc.).

Rubric

Total marks: 100

Below, the top-level number is the items total point value. If an item is not submitted at all, 0 points will be awarded for that item. The sub-bullets indicate standard deductions for errors in a submitted item. The deduction list below may not be complete because there may be mistakes that we did not expect. The deduction for an unexpected mistake will be assessed at the time it’s discovered and will reflect how severe the instructor thinks the mistake is.

Other deductions:

© Scott D. Fleming 2018 • Made with GitHub Pages and Markdown