Exercises: The Early Bird Gets the ORM!

Now that we have gotten very familiar with our coding-events application, let’s design some additional features. As you work on your coding-events application, you may have been inspired by Meetup ! One of the cool features that Meetup has is that people can sign up for accounts. They can use their Meetup accounts to follow the events they are most interested in and keep track of their calendar of events. To add similar features to coding-events, you need to add a Person class. For the exercises, answer the following questions about what your Person class would look like.

Note

You do not have to code anything to complete these exercises! This is mainly focused on using our design skills to add a new feature to your application.

  1. You need to add a Person class to hold necessary info about users of our app. What fields and methods would this class hold?
  2. Would you need to add any additional classes to Person to make the app work? If so, what classes would be necessary?
  3. What kinds of relationships would Person have to the other classes you already created, such as the Event class?

As you dream up answers to these questions, write the answers down in a note or piece of paper. You are now going to write up some documentation for your app!

  1. Add a README.md to your repository by navigating to the repository page on your GitHub profile. At the bottom of the page, there is a blue banner asking you to add a README.md. Click the button to do so!
  2. You should write three sections. The first should describe the purpose of the app. The second should describe the current state of the app. The third and final section should describe the future improvements you want to make to the app including your notes about the Person class.

Here is an example of how the README may turn out:

  1. Our Person class might hold the following fields:

    1. id (int) - the unique user ID
    2. firstName (String) - the user’s first name
    3. lastName (String) - the user’s last name
    4. email (String) - the user’s email, which will also function as their username
    5. password (String) - the user’s password

    The class would need getters for all of these fields. It could have setters for all fields except id (since it shouldn’t change).

  2. The Person class might also have the following references:

    1. PersonProfile - a class to gather up all of the profile information about the user
    2. List<Events> eventsAttending - to store events the user wants to attend
    3. List<Events> eventsOwned - a different list, to store the events the user has created

Person would have a many-to-many relationship with Event via List<Events> eventsAttending. It would have a one-to-many relationship with Event via List<Events> eventsOwned.