ThreeDotsLabs / wild-workouts-go-ddd-example

Go DDD example application. Complete project to show how to apply DDD, Clean Architecture, and CQRS by practical refactoring.
https://threedots.tech
MIT License
5.24k stars 479 forks source link

The power of generics in go for the repository pattern? #57

Open frederikhors opened 2 years ago

frederikhors commented 2 years ago

I just found this awesome post: https://hindenbug.io/the-power-of-generics-in-go-the-repository-pattern-for-gorm-7f8891df0934.

What do you think guys?

On reddit the discussion is hot too: https://www.reddit.com/r/golang/comments/u9bti2/the_power_of_generics_in_go_the_repository.

I'm repeating (manually or by code generation) a lot of times the same code in many files for this.

What we can do?

frederikhors commented 2 years ago

Maybe a post on the Specification pattern (like https://levelup.gitconnected.com/practical-ddd-in-golang-specification-6523d14438e6) would be awesome to clarify and clean up repository code.