Replies: 1 comment
-
I'm also struggling to use other services in one service, some business logic involved multiple database models and using relationship is not enough. Currently, I'm trying to abstract a universal layer to place all the business logic there, it has methods to provide all the advanced-alchemy services needed or use the services injected in the router handler. The layer will be initialized with database session, it combines the services to do the business. I'm not sure whether it follows the best practice. If some business logic involved with multiple database models, what's the best practice? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, there is no way to pass a session object at runtime. Ideally, we should be able to create a repository object and pass a session or inject a session while calling a repository method. We have 45 services and 57 repositories, and this feature could help us access any service from any other service and do the same with repositories.
Before I became familiar with this library, I was implementing it like this:
Loading the Database State
The database is loaded like this:
Loading Services into the Application State
Services are loaded into the application state during startup using a for loop.
Beta Was this translation helpful? Give feedback.
All reactions