You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a large domain with a lots of services using the storage, each defining it's own repository interface, then putting those implementations in a single folder under storage/
I find this pattern gets out of hand really quickly, it's fine for smaller examples like the beer review in this repo, but for large APIs where the storage needs to implement a couple of dozen or hundred repository functions is not really usable.
How would you organise the storage folder to break it down more?
I thought of moving the repository implementations in the domain logic, but that would circumvent this architectural pattern; and by further breaking down everything into sub-folders inside storage/ would circumvent Go's package layout.
The only, somewhat, manageable pattern I found is to create files under storage/ by the entities it represents, like storage/job.go, storage/ticket.go, storage/beer.go and write the repository implementations in these files.
Any other ideas?
The text was updated successfully, but these errors were encountered:
If you have a large domain with a lots of services using the storage, each defining it's own repository interface, then putting those implementations in a single folder under storage/
I find this pattern gets out of hand really quickly, it's fine for smaller examples like the beer review in this repo, but for large APIs where the storage needs to implement a couple of dozen or hundred repository functions is not really usable.
How would you organise the storage folder to break it down more?
I thought of moving the repository implementations in the domain logic, but that would circumvent this architectural pattern; and by further breaking down everything into sub-folders inside storage/ would circumvent Go's package layout.
The only, somewhat, manageable pattern I found is to create files under storage/ by the entities it represents, like storage/job.go, storage/ticket.go, storage/beer.go and write the repository implementations in these files.
Any other ideas?
The text was updated successfully, but these errors were encountered: