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

Refactoring Db/Ddb/Fixtures (Module boot -> middleware execution -> run) #664

Open
applike-ss opened this issue Jan 6, 2022 · 0 comments

Comments

@applike-ss
Copy link
Contributor

Currently some components do some magic when they get created.
E.g. the db runs migrations, ddb creates tables, etc.

This should be changed in a way that:
Boot: creates the instantiation of a struct (e.g. db repo, ddb repo) and registers the component in the appctx. If e.g. the ddb repo needs to create a resource, then it needs to define a Middleware that is registered also in the appctx and which will then be executed later by the kernel.

Post-Boot-Pre-Middlwares: Here we want to start the test components (not part of the kernel)

Middleware: executes migrations and resource alterations
Run: Regular module run implementation

We also want the fixture writers as a middleware and don't want to rely on the config to see whether a test component is required or now. This is to improve convention over configuration and overall usability.
The appctx should have all components registered and should be used to determine which test components need to be booted.

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

No branches or pull requests

1 participant