AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Creating a Go project typically involves initiating a go mod project and generating a CMD folder containing the project name for distinct binaries. Following an internal folder practice with enforced regulations ensures encapsulated packages. For instance, a domain like loyalty would have a loyalty.go file holding models and services.
GRPC plays a crucial role in honoring published language contracts for seamless communication. Protobufs ensure type safety and compatibility across various languages. The enforcement of internal packages prevents unexpected dependencies, aligning well with domain modeling and language isolation.
A versatile approach in organizing HTTP handlers involves placing them either inside relevant domain folders, such as payments or creating a dedicated transport package for all handlers. The key is to maintain loose coupling, where handlers focus on request validation and interaction with service layers for streamlined HTTP operations.
Incorporating Test-Driven Development (TDD) principles within domain-driven design projects offers enhanced safety and clarity in code functionality. By adhering to TDD practices and maintaining robust test coverage, developers ensure efficiency and reliability in their domain-driven design projects.
Developers share their approach to structuring code, discussing the benefits of organizing handlers based on related functionality to enhance code clarity and maintainability. By grouping handlers according to distinct functionalities such as loyalty and payments, developers find it easier to manage and navigate the codebase, minimizing complexity. They debate the challenges of handling diverse sets of handlers and the importance of creating clear boundaries between them to avoid unnecessary entanglement.
The podcast delved into the critical need for maintaining separation between business logic and database models to prevent tightly coupling them. By segregating internal types from database-related types, such as creating separate store and repository packages, developers avoid pitfalls like letting the database dictate the application's design. This separation of concerns not only aids in upgrading or migrating databases but also fosters better application design practices by decoupling business logic from database specifics for long-term flexibility.
Matthew Boyle, the author of Domain-Driven Design with Golang, sits down with Jon & Mat to talk about (you guessed it!) DDD with Go.
Changelog++ members get a bonus 6 minutes at the end of this episode and zero ads. Join today!
Sponsors:
Featuring:
Show Notes:
Something missing or broken? PRs welcome!
Listen to all your favourite podcasts with AI-powered features
Listen to the best highlights from the podcasts you love and dive into the full episode
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
Listen to all your favourite podcasts with AI-powered features
Listen to the best highlights from the podcasts you love and dive into the full episode