Skip to content

Instantly share code, notes, and snippets.

@BlakeDonn
Last active August 25, 2020 02:50
Show Gist options
  • Save BlakeDonn/b5b59c8ca727c9528971116f125bbeba to your computer and use it in GitHub Desktop.
Save BlakeDonn/b5b59c8ca727c9528971116f125bbeba to your computer and use it in GitHub Desktop.
class-strucure.md

UserRepository stores all User-related objects in an array.

On load it will be the catalyst for all methods (pulls ID from somewhere)

  • let allUsers = new UserRepository(userData)

  • let currentUser = returnUserData(ID)


Individual user class instantiated with matching user object from User dataset

  • This will be our representation of our user, will be responsible for displaying welcome

let assignedUser = new User(currentUser)


HydrateRepo class = the class that holds the methods to interact with the hydration dataset

Hydrate class = (could we use static methods with id as argument? Or instatiate with only an ID?)

  • since Hydration class only needs to calculate and return, it should not store data

SleepRepo class = the class that holds the methods to interact with the Sleep dataset

Sleep class = (could we use static methods with id as argument? Or instatiate with only an ID?)

  • since Sleep class only needs to calculate and return, it should not store data

ActivityRepo class = the class that holds the methods to interact with the Activity dataset

Activity class = (could we use static methods with id as argument? Or instatiate with only an ID?)

  • since Sleep class only needs to calculate and return, it should not store data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment