bxcodec / go-clean-arch

Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture
MIT License
9.03k stars 1.19k forks source link

Definition of domain #105

Open aimuz opened 3 months ago

aimuz commented 3 months ago

I'm not sure about the definition of domain right now, for usecase, he shouldn't care if the repo is stored by mongo or mysql or some other database as the underlying storage.

For usecase, he needs a detailed data, for example.

type Book struct {
    Name string
    Authors []Author
}

type Author struct {
    Name string
}

This is the simplest tree data, inside Mongo I can easily put it inside an object, whereas inside a relational database I need to put them inside multiple tables.

My question now is, how is domain defined? If it's a tree structure, shouldn't MySQL's Repo implementation also return a tree struct?