Closed bxcodec closed 6 years ago
There will be a new packages called: models
models
├── article.go
├── author.go
└── errors.go
This package models
, will store any models used in entire projects
And for each domain, will have the other layer like : repository, usecase and delivery. And moving the interface to the root of domain. This how it looks now:
article
├── delivery
│ └── http
│ ├── article_handler.go
│ └── article_test.go
├── mocks
│ ├── ArticleRepository.go
│ └── ArticleUsecase.go
├── repository //Encapsulated Implementation of Repository Interface
│ ├── mysql_article.go
│ └── mysqlarticle_test.go
├── repository.go // Repository Interface
├── usecase //Encapsulated Implementation of Usecase Interface
│ ├── articleucase_test.go
│ └── artilce_ucase.go
└── usecase.go // Usecase Interface.
My reason making this structure are:
package system
, the article domain, become a package that only provides interface function to outside(article/usecase.go
and article/repository.go
), without displaying the implementations.For some people this arch, will not solve their problem, so make sure to search others do, that may be fit to your problem.
Proposed Changes:
Close #7