Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition to rendering the boxes for each activity, the view also dynamically updates the activity boxes as they are moved and resized so that they show error messages, map labels and the current duration and times.  A single activity can be selected, at which point, it greys out parts of the schedule in which the selected activity cannot be done between.

TODO: Andrew: maps

Model

TODO: Andrew

- object array / uniqid

- invariant checking

The fundamental object in our application is an activity: something that can be done at a particular location in between two particular times. There was simply an array of these, each with a unique id. This activity could be in one of four states: 

- Suggested, as one of the events that the google palces API returned or one of our created events. These were not visible except in autocomplete.
- Todo, as an event in the middle column that the user was interested in visiting but not certain.
- Scheduled, as an event placed on the schedule and itinerary.
- Locked, which was also placed on the schedule, but unable to be displaced without being unlocked.
Three things could be done to these events:
- They could change state, and there were a number of functions provided by the model to do this while preserving invariants. Of course, javascript is still a dynamic language and so no real invariants could be enforced.
- The event could be selected or deselected. Only one event at a time could be selected.
- Other properties such as start time, end time, opening, closing, location, or name could be changed.
Views each register handlers to such changes in an activity. Thus, when an event's time changed in the schedule, the schedule updates the model, which files all handlers for that change, which fires the handlers in the view, form, and map. The function call to propegate the change can take a parameter naming a view whose handler should not be called. This allows us to prevent the schedule from twice dealing with the movement of an event.
Model: The fundamental object in our application is an activity: something that can be done at a particular location in between two particular times. There was simply an array of these, each with a unique id. This activity could be in one of four states: 

- Suggested, as one of the events that the google palces API returned or one of our created events. These were not visible except in autocomplete.

- Todo, as an event in the middle column that the user was interested in visiting but not certain.

- Scheduled, as an event placed on the schedule and itinerary.

- Locked, which was also placed on the schedule, but unable to be displaced without being unlocked.

Three things could be done to these events:

- They could change state, and there were a number of functions provided by the model to do this while preserving invariants. Of course, javascript is still a dynamic language and so no real invariants could be enforced.

- The event could be selected or deselected. Only one event at a time could be selected.

- Other properties such as start time, end time, opening, closing, location, or name could be changed.

Views each register handlers to such changes in an activity. Thus, when an event's time changed in the schedule, the schedule updates the model, which files all handlers for that change, which fires the handlers in the view, form, and map. The function call to propegate the change can take a parameter naming a view whose handler should not be called. This allows us to prevent the schedule from twice dealing with the movement of an event.- handler propegation

Scheduling algorithms (Controller)

...