This post discusses designing programs in Go using a layered approach, emphasizing the importance of avoiding circular dependencies. It describes how to structure packages hierarchically to meet Go's requirements and reveals techniques to handle dependencies without causing circular references. The methodology suggests multiple strategies, such as moving functionality, creating a third package, using interfaces, and more. The benefits highlight improved conceptual clarity and ease of understanding code due to well-defined package dependencies.

24m read timeFrom jerf.org
Post cover image
Table of contents
Deriving Some RequirementsLayered Design In GoAvoiding Circular DependenciesSo What’s The Difference Between This And Anything Else?

Sort: