katzien / go-structure-examples

Examples for my talk on structuring go apps
MIT License
2.35k stars 287 forks source link

Contains changes to make layered code work #28

Closed ajayvm closed 3 years ago

ajayvm commented 3 years ago

Hi, I am an architect by profession and coded in java for eons long time back. learning golang. i think your layered package is not how we do in enterprise world. in the layered folder, the storage.go should ideally not be in models but in the storage package. this way model remains clean and doesnt know about persistence. in terms of heirarchy, the models are way at base, storage (or persistence layer) depends on models and the business logic (main,handlers) depend on storage and models. there is no cyclic dependency whatsover.