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

Implement a data loader #21

Open
jChicote opened this issue Oct 25, 2023 · 1 comment · Fixed by #23
Open

Implement a data loader #21

jChicote opened this issue Oct 25, 2023 · 1 comment · Fixed by #23
Labels
enhancement New feature or request

Comments

@jChicote
Copy link
Owner

Description

Preloading all the data will not be optimal with the magnitude of asteroids and planet data that will be loaded from the API. On a slow connection, pre-loading all this data may even exceed 3 or 5 minutes. Therefore, a dataloader factory will be created to produce the data loading mechanism to get the data from the API.

Acceptance Criteria

  • Data can be loaded on demand and when necessary
  • Factory can load the data when needed
  • Multiple data loaders can be created

Implementation

  • Create a DataLoader factory that has a create data loader method
  • The method will accept a string input and if matched, load the requested data
  • Create a PlanetDataLoader class, and give it a load method that will load the requested data from the API gateway. With the loaded data as a response invoke the create planet method with the response data provided.

Modifications to existing implementation

  • The interactor will access the repository and add the planet within
  • The GetMainPlanet data will need to be renamed to CreateMainPlanet
  • A Get controller action will need to exist to get the data from the API. This will have to be lightweight as possible and accesses the repository.
@jChicote jChicote added the enhancement New feature or request label Oct 25, 2023
@jChicote
Copy link
Owner Author

Notes:

  • Create dataloader
  • Create GetPlanets endpoint

@jChicote jChicote linked a pull request Oct 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant