This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
bug(typing): GenericMockRepository and Service generic type too narrow #170
Comments
peterschutt
added a commit
that referenced
this issue
Dec 16, 2022
The coupling between the base service object and a repository type was too inflexible to be useful when building an app that doesn't need a repository. `service.Service` is no longer aware of `repository_type` and has no default implementations defined. To get the same behavior as previous versions, service objects should now inherit from `service.RepositoryService`. This is for #170, but #170 is broader than this change. We still need to make the repository service not _need_ to use SQLAlchemy ORM types as the model type.
This is done in #171 - but the rest of this still needs to be done. |
peterschutt
added a commit
that referenced
this issue
Dec 16, 2022
The coupling between the base service object and a repository type was too inflexible to be useful when building an app that doesn't need a repository. `service.Service` is no longer aware of `repository_type` and has no default implementations defined. To get the same behavior as previous versions, service objects should now inherit from `service.RepositoryService`. This is for #170, but #170 is broader than this change. We still need to make the repository service not _need_ to use SQLAlchemy ORM types as the model type.
peterschutt
added a commit
that referenced
this issue
Dec 16, 2022
`service.Service` is no longer aware of `repository_type` and has no default implementations defined. The coupling between the base service object and a repository type was too inflexible to be useful when building an app that doesn't need a repository. To get the same behavior as previous versions, service objects should now inherit from `service.RepositoryService`. This is for #170, but #170 is broader than this change. We still need to make the repository service not _need_ to use SQLAlchemy ORM types as the model type.
The other stuff about not having the generic mock repository typed to |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There is no reason that applications built on this lib must be modelled on SQLAlchemy.. if there is no reason for the app to use database storage it makes no sense to enforce it.
This means that it is wrong to have
Service
andGenericMockRepository
bound toDeclarativeBase
viarepository.types.ModelT
as we do.The only requirement for Service is that the repository type has to support the type supported by the service object.
Perhaps we need a
Service
andRepositoryService
type as well, that would allow creating service objects without having to worry about repositories when they aren't needed (i.e., apps without persistent storage).The text was updated successfully, but these errors were encountered: