Repositories are used to interact with the database
Repositories in Orionjs are specialized services that handle data access operations. They follow the repository pattern, which separates data access logic from business logic, making your code more maintainable and testable.
Repositories use the @Repository
decorator, which is a semantic distinction from @Service
to clarify the component’s purpose:
While repositories are functionally similar to services (both use dependency injection), they serve different purposes:
This separation of concerns leads to:
Like services, repositories can be injected into other components using the factory function pattern:
Repositories are used to interact with the database
Repositories in Orionjs are specialized services that handle data access operations. They follow the repository pattern, which separates data access logic from business logic, making your code more maintainable and testable.
Repositories use the @Repository
decorator, which is a semantic distinction from @Service
to clarify the component’s purpose:
While repositories are functionally similar to services (both use dependency injection), they serve different purposes:
This separation of concerns leads to:
Like services, repositories can be injected into other components using the factory function pattern: