Increasing Cohesion in Go with Generic Decorators
Cohesion is part of the low coupling, high cohesion principle that’s supposed to keep your code maintainable. While low coupling means few dependencies, high cohesion roughly translates to single responsibility. Highly cohesive code (a module or a function) is focused on a single purpose. Low cohesion means it does many unrelated things. I’ve written about coupling in the previous article on anti-patterns.
Popular
- The Go libraries that never failed us: 22 libraries you need to know
- Safer Enums in Go
- Common Anti-Patterns in Go Web Applications
- How to implement Clean Architecture in Go (Golang)
- The Repository pattern in Go: a painless way to simplify your service logic
- Introduction to DDD Lite: When microservices in Go are not enough
Tags
- go
- golang
- watermill
- ddd
- domain-driven design
- web-applications
- anti-patterns
- clean architecture
- events
- ci
- firestore
- cloudrun
- gcloud
- googlecloud
- serverless
- advanced
- databases
- devops
- firebase
- gitlab
- microservices
- reactive
- repository
- testing
- architecture
- basics
- building-business-applications
- cqrs
- event-driven
- kafka
- mysql
- nats
- pipelines
- scalability
- transactions
- amqp
- authentication
- backend
- bounded-context
- c4
- cicd
- design-patterns
- diagrams
- docker
- dry
- e-book
- enums
- event-storming
- frameworks
- gamedev
- generics
- google-cloud
- grpc
- htmx
- intermediate
- javascript
- libraries
- maintainability
- metrics
- monolith
- openapi
- prometheus
- python
- rabbitmq
- security
- software-architecture
- sql
- sse
- strategic-ddd
- swagger
- terraform
- tips
- versioning