Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cohort 1.5 exercise #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Cohort 1.5 exercise #6

wants to merge 1 commit into from

Conversation

northernseagull
Copy link

  • not sure done the datastore initializing/abstraction properly
  • used http methods to get the post vars as didn't know how to get from martini
  • not sure if the methods i added (GetBookById etc) are right way to do things?

@tomw-1
Copy link
Collaborator

tomw-1 commented Mar 16, 2022

  • not sure done the datastore initializing/abstraction properly
  • used http methods to get the post vars as didn't know how to get from martini
  • not sure if the methods i added (GetBookById etc) are right way to do things?
  • The datastore init is done fine. Each request is essentially in its own thread, so init'ing the context and client each time is ok. You could keep a local instance variable for each and only create if these are nil for marginal improvements
  • You can use bindings to get out of the http request a little cleaner, but I'm not sure if they work with request params rather than request body
  • The methods are right. But possibly in the wrong place. Having it in the models package/folder feels off. I would prefer it to have the model as being just the struct definition, then having a book service/interface which handle the get/save methods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants