I started design with Scala class classes as models, and I was interested to learn about the design decision.
Suppose we have two models: a model Userand a model Order. The model Orderrefers to the model Useras a foreign key.
case class User(id: UserId, [Other fields...], password: String)
case class Order(id: OrderId, [Other fields...], userId: UserId)
Then, given this construction, we will have a OrdersDAO with the method findByUser.
My question is: will a good design have a method Ordersin Userthat calls this DAO method and thus makes the system more OO or better isolate layers and not include this method
Thank!
source
share