go-clean-arch icon indicating copy to clipboard operation
go-clean-arch copied to clipboard

Definition of domain

Open aimuz opened this issue 1 year ago • 0 comments

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?

aimuz avatar May 13 '24 09:05 aimuz