8
I'm new to Domain Driven Design and I have some doubt about some concepts (hoping that this is the right place to ask this).
I know that in DDD I should avoid an anemic model, so thinking about a social network model who should make (save) the friendship between two friends?
I imagine the situation like having a class representing the Users (using a Java-like syntax):
class User{
String username
List<User> friends
}
So, should it have a method to add a friend?
class User{
void friendship(User friend)
}
or should I have to use a service to do it?
class UserService{
void friendship(User user, User user2)
}