Skip to content

Commit

Permalink
Merge pull request AdaGold#12 from AdaGold/Hamled/rolodex-review
Browse files Browse the repository at this point in the history
Changes to Rolodex review
  • Loading branch information
Dan Roberts authored Dec 15, 2016
2 parents ea380be + 1394007 commit 310b2b5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,16 @@ App.js is our starting file for execution. It creates the models & our Applicat

### Views
- **ApplicationView** was the most arbitrary. Why is it there?
- The ApplicationView controls the whole viewport and handles the form for creating new Contacts.
- The ApplicationView controls the whole viewport and handles the form for creating new Contacts. It also directly manages the RolodexView instance.
- **RolodexView**
- The RolodexView manages the list of Contacts and listens for events on the collection and when individual cards are selected. When a card is selected it triggers an event which the Rolodex listens to. Then the Rolodex updates the modal to show the contact details.
- The RolodexView manages the list of Contacts and listens for events on the collection and when individual cards are selected. When a card is selected it triggers an event which the Rolodex listens to. Then the Rolodex updates the modal to show the contact details. It also directly manages all of the ContactViews instances.
- **ContactView**
- A ContactView renders one Contact Model using an underscore template.
- A ContactView renders one Contact Model using an Underscore template.


Notice that our views only directly interact with DOM elements inside their areas of concern. So the Cards only change HTML within their particular <DIV> element, while the RolodexView does not interact with the form.
Notice that our views only directly interact with DOM elements inside their areas of concern. So the Cards only change HTML within their particular <DIV> element, while the RolodexView does not interact with the form.

Likewise, when one view directly manages another view (such as with the RolodexView and its ContactViews) that view effectively _delegates_ responsbility for some of its DOM elements to the _child_ view. The RolodexView does not directly change the HTML within any of the <DIV> elements assigned to ContactViews.

### Models

Expand Down Expand Up @@ -158,7 +160,7 @@ We'll include all events here, not just custom ones.
| Click on `Clear` button | DOM | The user | ApplicationView |
| Click on a contact card | DOM | The user | ContactView |
| Click off a contact card | DOM | The user | RolodexView |
| `update` the Rolodex | Backbone Automatic | Backbone when the collection is updated. Updates come from ApplicationView (add a contact) | RolodexView |
| `update` the Rolodex | Backbone Automatic | Rolodex (the collection). Updates come from ApplicationView (add a contact) | RolodexView |
| `select` a contact card | Custom | ContactView when the card is clicked | RolodexView |

Is anything missing from this list that you used in your version of Rolodex?
Expand Down

0 comments on commit 310b2b5

Please sign in to comment.