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

Spike: Create Repository in JSLB4 #2477

Closed
hacksparrow opened this issue Feb 26, 2019 · 3 comments
Closed

Spike: Create Repository in JSLB4 #2477

hacksparrow opened this issue Feb 26, 2019 · 3 comments

Comments

@hacksparrow
Copy link
Contributor

Follow up task for of #1978.

Acceptance criteria

a. Should be created as a class
b. Should be automatically loaded in the LB4 app
c. Should have access to a specified Model
d. Should expose CRUD methods to interact with the Model
e. Should allow custom methods to be added, with access to:
i. The LB4 request object
ii. A Model

@bajtos
Copy link
Member

bajtos commented Feb 26, 2019

One more thing to consider, I am not sure if it belongs here or to DI-related story #2473: we need a way how to customize the datasource configuration used by the repository.

In TypeScript, this is achieved via dependency injection:

  • DataSource config is loaded from datasources/{name}.json and bound in Context
  • For each DataSource, we have a custom class that receives its config via DI, defaulting to loading the config directly from the JSON file.
  • Each repository class receives the DataSource instance to use via DI, defaulting to creating a new instance of the DataSource class created above.

The solution above is an implementation detail, we can use different approach in JavaScript. Here are the stories that are important for app developers:

  • As an app developer, when running my app in test/staging/production environment, I want to customize my datasource configuration based on values supplied via ENV variables (see https://12factor.net).
  • As an app developer, I want the option to use custom datasource configuration (connection string) when running my automated test suite via npm test on developer machines.

@stale
Copy link

stale bot commented Feb 22, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Feb 22, 2020
@stale
Copy link

stale bot commented Mar 23, 2020

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants