我愿以下列方式在Schala实施保护儿童组织:
trait DAO[PK,-T,-Q] {
// T is a "value object", PK is a primary key, and Q is query parameters.
def create(t:T):Unit
def update(t:T):Unit
def remove(pk:PK):Unit
def find(query:Q):Seq[T]
}
Does it make sense ? Doesn t it look "too Java" ? How would you design/implement DAO in Scala ?